Qui Gon Gin’s lightsaber style relies vastly on open spaces, using sweeping movements regularly in battle. The closed room gave him a huge disadvantage. On the other hand, although Darth Maul wielded a double-bladed lightsaber, which also suffered in enclosed spaces, Maul uses tight, economic movements that keep the blades relatively close to his body.
Although Obi Wan is not exceptionally force sensitive or talented at dueling, he is exceptionally diligent in his studies in both fields. His combat style fluidly uses the Force to augment his fighting style, and like Qui Gon Gin, he uses it to gain insight and guidance mid-battle.
In fact, as soon as he started tapping into the dark side after Qui-Gon’s death, his moves started to take on an entirely different form from before, a more aggressive, efficient, and heavily augmented style of fighting. However, even that eventually became overwhelmed by Darth Maul’s prowess.
Towards the end of the battle, Darth Maul became arrogant, assuming he had won the battle. It quickly became a nearly lethal mistake, leading to the loss of his lower body. In canon, Darth Maul survives even this, and reappears in the Clone Wars.
On the other hand, when Obi Wan battled Anakin, it was Anakin who made the deadly mistake of becoming cocky. Having nearly died in an almost identical situation, Obi Wan was likely the hardest possible opponent to beat in that situation.
By the time he dueled Anakin, Obi Wan had grown immensely in terms of dueling prowess, even earning Mace Windu’s respect as the sole master of his chosen lightsaber style. His skill in combat, his familiarity with Anakin’s thoughts, Anakin’s arrogance, and the countless times Obi Wan had relived that duel with Darth Maul added up to a clear-cut conclusion: Anakin lost the duel as soon as Obi Wan gained that specific positional advantage. Namely: Obi wan was higher up, and Anakin had to jump to reach him.