IIRC elephants were not terribly successful against Romans at least. They found it was quite easy to wound the animal with javelins, so that its handlers lost control and it simply charged about at random, or, even worst, turned tail from the javelin throwing Romans and piled back into the carthaginians.

There is also the problem that so far as I know domesticated elephants are captured wild elephants (ie not bred in captivity). I assume this was so in Roman times. I have never quite worked out where the Carthaginians got their elephants from (since if there are wild elephants on the Libyan coast its news to me). I assume they traded with India, but they can't have had many. I think Livy says how many Hannibal had after crossing the Alps and its very few indeed.

So even if they were any good you would not be able to have many in an army.