[In Infinity War] We are led to believe that the only reason they are unable to beat Thanos is because Quill loses his cool and because Thanos is wielding all but one of the Infinity Stones
No, we're not. The rag-tag assemblage of heroes are just about able to use their combined powers and the element of surprise to pacify Thanos long enough to nearly get the gauntlet off, and they can only do that thanks to Mantis' psychic powers, which are so strong they put a Celestial to sleep.
While pacified, he's not actually using the Stones (of which he has all but two, as Strange and Vision still have the Mind and Time Stones respectively), as that requires him to make a fist with the gauntlet. Despite that, it's all they can do to keep him subdued until Mantis gets knocked off him and it's essentially game over.
In contrast, when Thanos is on the front-foot and face-to-face with the other Avengers one-on-one in Wakanda, it's mostly no contest at all, even before he uses the Time Stone.
[In Endgame] we have an arguably superior force... all in peak form against an unarmed and unarmored Thanos (with zero stones) who is weakened and injured already -- not to mention that he no longer has any motivation to live. But he holds his own for a surprisingly long time
No, he doesn't.
(Also they have Captain Marvel; it's inarguably superior, physically.)
He’s immediately knocked down and put in a headlock by Captain Marvel, then has his arms held by Banner in the Hulkbuster armour and War Machine. He's apparently unable or unwilling to break free from this restraint, unlike on Titan.
Thor then immediately cuts his gauntlet hand off with Stormbreaker, and Rocket discovers the Infinity Stones aren't there. Captain Marvel releases the headlock as Banner pushes Thanos to the floor and punches him. That's the extent of the physical confrontation. Thanos stays down, and the Avengers aren't trying to fight or kill him. They just want to know where the Stones are.
Once Thor decides the interrogation is futile, he immediately chops Thanos’s head off, with no apparent defensive reaction from ol’ Purple Chops.
He had already been nearly killed in the act of ensuring that his life’s purpose couldn’t be reversed, so he’s both in poor physical shape (as we see when he climbs the stairs to his shack), and has nothing to fight for. He didn't hold his own; he did nothing. He was done, and ready to die.