When I first gained sight at elephants playing as romans, I thought it was going to be very tough...
well, it wasn't. I had one bunch of mounted akritae and those elephants died like flies, I lost 4 horsemen.
I was a bit confused and disappointed after this, so I started some custom battles against elephants. The results were all the same: javelins are ing devastating, arquebuses are not (they just scratch), muskets are as effective as javelins (but that should be obvious).
It bothers me a bit that all you have to do is to recruit some javelin throwers for 300 to counter elephants which cost 3000. After all I want to be forced to use artillery and armor piercing polearms when facing elephants.