My experience so far with elephants is that you will (probably) not win with them against formed infantry if the infantry are shieldwall/phalanx or are superior. That assumes the infantry passes its cohesion test when charged by the beast, which makes elephants attacks somewhat of an all or nothing one shot proposition. Unless you are charging lesser quality foot.
Jim