>>The last major battle using (African) elephants in the Med basin was Thapsus, at the close of the second phase of the Pompeian War.<<
Well, that and the Battle for Gondor.
Thapsus was fought between Caesar and the Optimates, who opposed his dictatorship. The Optimates fled to Africa and Caesar followed them. The war elephants were in the Optimate army, which lost the battle. Caesar got some elephants to panic by raining arrows on them, after which the elephants trampled their own troops. They looked fearsome to infantry, but really didn’t add much to the Roman way of war.