Just don't allow them to get stuck, continue charging one unit after the other. With just one unit of cavalry behind to charge on the already messed enemy unit in case it hasn't routed yet, it guarantees routing 100% of the time. I they are already routed you can use your cavalry to without tiring your elephants, who should be charging the next unit. With only one unit of elephants and one of cavalry you can slaughter an infantry army of almost any size, and probably without any casualties.

They are also very good against chariots. You can soften the chariots first with arrows and use some velite gladiators (if you have them) or skirmishers to aid the elephants when the chariots get bogged among them.

I only have had a unit of mercenary elephants, so I haven't used them very much, but are really worth it. The other day I completely slaughtered a gallic army, including the chariots of their general, for a total of about 1300 men with an army of 180 soldiers with the elephants on their lines. I had only about 15 casualties. In another battle they managed to get a kill board of 658.