I'm specifically referring to battles where people were not using guns.
After seeing how tired boxers and MMA fighters get after Boxing for twenty minutes or less, how long realistically would a regular soldier be able to swing a sword?
Especially with all the armor on, the adrenaline, and the weight of whatever weapon they were carrying, I can't image battles lasting longer than an hour? Everyone would be too tired to move, except maybe a few incredibly fit people.
Even with the rotating of soldiers in and out, it sounds incredibly tiring.
I am going to speak with my own speciality related to ancient Roman warfare. The answer seems to be: hours. We occasionally hear about how long a battle lasted, for example the main fight at Pydna lasted about an hour, although the pursuit went for several hours into the night.
Philip Sabin ("Face of Roman Battle", Journal of Roman Studies 2001) has argued that we can at times use maneuvers reported in battles as a sort of "internal clock," for example at the Battle of the River Metaurus, the Romans redeployed troops from their left flank all the way to their right, process that must have taken a considerable amount of time, and suggesting that the overall battle was at least several hours long.
Hollywood often leads us astray, and consistently film portrays Iron Age warfare as a pretty brisk orgy of killing. Mel Gibson's Braveheart is perhaps the exemplar: both sides charge, and the killing happens continuously and ferociously until all the enemy are dead. A two hour film, after all, generally can only give 10 minutes or so even to a major battle. So Hollywood battles seem very sudden affairs.
As the prompt notes, humans can only engage in intensive physical activity for minutes at a time. Boxers and MMA fighters, in peak condition, quickly tire. The same was no different for ancient soldiers. How did they make it through battles that could take hours? The basic answer: they were not fighting the whole time, or anywhere near it.
Firstly, in many parts of ancient battles, parts of formation faced each other (the military term is "fixing", but did not necessarily engage while manuver and combat took place on other parts of the battlefield.
But even for units in direct contact, it seems that battle was characterized by clashes and lulls; this is the model proposed by Sabin. That is ranks might clash, fight furiously for a few minutes, and then back off a bit to catch their breath, deal with killed and wounded, and perhaps exchange insults and missiles from a distance, before re-engaging for another brief fight. In many instances, the losing side in each scuffle might be the one breaking off and falling back, which is why we get so many reports of one side being "pushed" back, often considerable distance, despite seemingly maintaining ranks.
One thing about ancient battles, particularly Roman: the casualties were lopsided: the winner often suffered relatively light casualties, while the loser was often massacred (Classical Greek battles seem less bloody, but with losers suffering about twice as heavily as winners). What that means was that very little killing occurred in the battle itself: while soldiers could maintain their ranks, and use their shields and armor to protect themselves, only a handful of men fell, even when engaged in direct combat. It was only after one side collapsed that it was possible to chase down and kill soldiers who had lost the protection of their formations.