Very easy to beat elephants - use archers and javelins, you will eliminate the riders and cause the elephants to run amok. Historically elephants were almost a non-entity in combat - Alexander and Scipio faced them, and handled them easily. XGM nerfed them a little bit, so they are a little less lile “battle tanks”
The trick with a unit that has javelins is to make them hold their fir until the elephants are within range, then let loose with a mass javelin volley. Also, with velites, put them in skirmish mode and have them retreat in front of the elephants. Horse archers rock vs. elephants too.
XGM is also amazing for mercenary depth - you have Cretan archers, Balearic Slingers, Syrian Archers, Galatian Swordsmen, and literally dozens more mercenary types.