The ending of Maze Runner: The Scorch Trials turns an escape story into a war story: the Right Arm camp is destroyed, Minho, Aris and Sonya are taken, and Thomas decides to hunt down Ava Paige.
What actually happens? WCKD raids the camp after Teresa secretly passes its location along. Mary Cooper dies in the attack, and Teresa's betrayal is exposed. Thomas then resolves to kill Paige and free the captives.
What was the point of Maze Runner: The Scorch Trials? In my opinion, it exists to move the series from survival to confrontation. The first film, directed like this one by Wes Ball, asks how to get out of a sealed maze, while this one asks who built it and why the Immunes are being collected. By the final scene those questions have a name, WCKD, and a target, Paige.
Teresa is the hinge. It could be argued that her betrayal is the most important plot beat in the film, because it leads directly to the raid on the Right Arm camp and the capture of Minho, Aris and Sonya. The film spends its middle stretch building trust: Brenda and Jorge guide the group across the Scorch, and the Right Arm offers the first real shelter since the Glade. The raid takes that shelter away in a single night, and, paradoxically, the only person who could have prevented it is the one Thomas trusted most.
The film also sets up a pattern of loss. Winston is lost to the infection during the desert crossing, Mary Cooper dies in the raid, and three Immunes are carried off. In the 2014 original the group suffered its casualties inside the maze, with fixed rules to blame. Here the damage comes from people making choices, which is a harder kind of threat to plan around. That being said, the film never lets Thomas stop to grieve, and his vow against Paige is the only response it gives him.
Perhaps the cleanest way to read the ending is as a handoff. In Maze Runner: The Death Cure, Minho is a WCKD captive being used in research, and Thomas, Newt and Frypan head for the Last City to get him back. Gally, thought dead, turns up to help them inside, and Teresa, now working with WCKD, becomes a key figure in whether the plan can work. That rescue is the direct result of the final minutes here.
By comparison, the first film ends on an exit and this one ends on a promise. At 131 minutes it sits between the 113 minute original and the 143 minute finale, and its ending is the point where the trilogy stops being a puzzle and becomes a pursuit.