Javelins. Lots and lots of javelins. Any missile for that matter, but javelins seem to work best. However, in point of fact you don't want to kill them. What you want to do is either rout them or make them run amok. Doing that, they go crashing through the enemy ranks causing massive casualties, and the enemy either lets them rampage or kills them outright. I've never seen the AI use the spikes on elephants in RTW, either.
Bookmarks