Pre-gunpowder humanity would be toast.
> It would only work if the elephants were completely disciplined and ignored injury, death of friends, and noise
How about drugged elephants then? What if, in this increasingly sci-fi alt history setting, the elephants were just smart enough to figure out a) what kind of plant, mushroom or whatever makes them go berserk, b) realize berserk elephants are much better at effectively fighting humans, c) were willing to make individuals sacrifice themselves for the herd, and d) were able to consistently use berserk assaults as a battle tactic?
I know it's a lot of assumptions, but I won't have mere historical facts make me let go of the image of OG ultralisks attacking pre-industrial humanity.
Here's the fly in the ointment.
Berserk elephants would not be better at fighting in the same way that berserk humans aren't better at fighting. It's discipline and order that make an effective fighting force.
If you know anything about ancient hand-to-hand battles, you'd know that there were very few casualties during the battle proper. It's only when one side's formation broke and their soldiers became chaotic and disorganized that the real casualties occurred.
If I were to guess, I'd guess that you're getting this idea from movies where the main character harnesses emotion to become more capable and powerful. In the real world, emotional people die quickly and are generally ineffective.
It would be interesting to see them execute the Fabian strategy though.
We have pretty strong empirical evidence that real life elephants do not seriously outclass formations of humans armed with iron weapons. They were used in warfare in the Mediterranean for a few hundred years and in Asia for many centuries after that. They had some shock value, but never became a dominant, war-winning component of any army.
Even trained war elephants weren't great, or at least that was the conclusion of the Romans once they had enough experience with them.
They might be enough to route civilians, but probably not anyone in the military. Soldiers used to be expected to walk into enemy canon and musket fire with discipline and good order.
Also, there were black powder elephant guns. Apparently 4-bore rifles were popular for both big game and birds.