Rey isn’t actually overpowered for the most part, she just LOOKS overpowered. The real problem with Rey is this: her character flaw is her recklessness, but it never actually bites her in the butt in a meaningful way because the movie almost never puts her in a situation that doesn’t cater directly to her strengths. Finn and Han both get put in situations where they’re in over their heads and need Rey to save them (Finn way more than Han), but apart from her initial encounter with Kylo Ren on Takodana, Rey is never in a situation she can’t solve on her own, and even situations where she appears to need another character’s help (like needing Finn on the Falcon’s turret) end up flipping around so Rey does everything (Finn needs Rey to aim the whole goddamn ship for him). If Rey is both conscious and physically present in a situation, everyone else is just spectating.
When Rey behaves recklessly, she is consistently rewarded for it. When Anakin or Luke behave recklessly, it usually makes things worse for them (for example, Luke’s entire plotline in The Empire Strikes Back is basically him getting the recklessness beaten out of him one screwup at a time), but when Rey has a crazy idea to get the gangs off Han Solo and hits the wrong fuses it actually works out better, when she runs off into the forest it ends up protecting BB-8 from the First Order’s attack by getting him away from the cantina (and her capture gives Finn a reason to help the Resistance), and of course when she decides to fight with a weapon she has only touched once before in her life she completely destroys her opponent. At no point does Rey actually have to learn anything to succeed, she just needs to show up.
By contrast, Luke in ANH has to depend on his friends just to survive, let alone succeed. Neither Han nor Leia particularly like him when they meet him, but they grow together as a result of their experiences on the Death Star, since each one of them significantly and materially contributed to making the escape a success (Luke has the idea that gets them into the cell block, Leia gets them out, the droids save them from the compacter, Han and Chewie create a diversion and grab as much heat as they can, Leia covers Luke while he digs out the cable, Luke swings them across, Ben disables the tractor beam and distracts Vader, and of course Han flies them out of there). They’re an actual team, and Luke doesn’t handle the Battle of Yavin all by himself either: he’s saved by both Biggs and Wedge at different times and helps them in turn, and of course Han shows up at the end and saves him from Vader.
What’s more, Luke has to learn in order to succeed. He’s a skilled pilot and a good shot, but being a skilled pilot and a good shot isn’t gonna be enough: that’s why Red Leader isn’t the Hero of Yavin. Luke has to learn to let go and feel the Force to defeat the Death Star, and he doesn’t just intuitively know how to do it — he has to be taught by Ben.
Which brings us to the one and only way in which Rey is actually just overpowered: her Force abilities. She starts this movie believing Luke and the Jedi were myths. Luke lived in a time where he knew the Jedi were real, though he knew nothing about the Force or mind tricks. Rey, much later, believing they were legends, somehow knows about the mind trick AND how to resist a mind probe that she failed to resist on Takodana (since Kylo Ren probes her briefly there to learn that she saw the map), even though she doesn’t seem to know what the Force is until Kylo Ren mentions it (even though Maz talked to her about it earlier, because Abrams is sloppy). In previous films, we’ve only seen fully trained or nearly-fully trained Jedi attempt the mind trick, and in other parts of the new canon (and yes, they are all on the same level now) we see characters like Ezra Bridger with incredible raw Force potential consistently fail the mind trick even after months of training, but somehow Rey is able to just fumble her way to it on the spot even though she shouldn’t know what it is. I call BS on that scene in particular, and the duel’s outcome isn’t much more believable. An INTERESTING and BELIEVABLE result would have been something like Rey being forced into a fighting retreat, or the Falcon arriving during the duel and chasing Kylo off, or a stalemate where each of them marks or wounds the other, but instead we just got a chase through the woods followed by Rey turning around to curbstomp him harder than Anakin stomped Dooku at the Battle of Coruscant.
But TLJ really turned this around for me. Part of it is just Luke’s general impatience with her and constant trolling — in TLJ, Rey is allowed to get things wrong or be disliked by one of the good guys and still be a capable good guy. TFA seemed like it was insecure and terrified that if Rey ever made a real mistake we wouldn’t like her, but TLJ allows her to fall into Snoke’s trap by reaching out to Kylo, and then lets her fail to turn him back even though she was so convinced. She also gets put in situations in this movie where she can’t do it alone — for instance we have her fighting the guards alongside Kylo Ren, but we also have her turn as the Falcon’s gunner while Chewie flies, and the fact that although she’s the one to get the rocks out of the way so the Resistance can escape it was actually a team effort with Luke buying time and Poe leading the way out. Rian Johnson did what Abrams couldn’t: he made Rey a three-dimensional character who’s still strong and capable even though she can’t just win everything on her own (if not BECAUSE she can’t just win everything on her own).
TL;DR: TFA Rey is a Mary Sue because Abrams is a shitty writer who made her the answer to every situation and quibbling over her power level misses the point. TLJ Rey is NOT a Mary Sue because while Johnson may have his faults he understands characters much better than Abrams ever did.