I've seen it done tournament style - the GM put the players vs NPCs much like how it's done for Ash in the anime, until two players came up against each other. I think the GM then let them decide beforehand which character should win the battle, it was agreed upon.
In the RP I'm trying to start now, I went the easy route with the E4 instead. I'd probably have them schedule a time to challenge them, and let them play out majestic battles either controlling the E4 members themselves, or with me or other players controlling the opponents.
As for major end battles in RPs, maybe have a look at Atlantis Awakening and see how they did it. I've heard the players speak boldly of their posts there d: Same for Pokémon Odyssey (the first one) I think.