Quite hard to tell, the protagonists are usually there as templates for the player rather than their own individual character like other games, so their skill can't be properly measured, mainly when you are comparing them with characters from a vastly different universe with different battling style and sets of rules. So there's gonna be lots of assumptions here.
First, if you meant the game characters in the anime, then we will have to assume the game characters are used to the more unorthodox battling style from the anime, as opposed to assuming they are limited to turn-based battles where their Pokémon would stay still and take hits like champs, which of course, being an RPG, is a deconstruction of the actual battle that is up to the player's imagination rather than what we see. In this scenario, I'd say the game characters would beat most, if not all anime characters, in spite of being prodigious characters that are capable of sweeping a whole region on their first try. But with how creative the anime characters are, I'd say the likes of Ash would definitely be capable of getting a win by outwitting their opponents.
Now, in another scenario, if the anime characters are in the game, then it gets just as complicated, but at the same time simple. Assuming the anime characters have their peak teams, with top-notch experience of the battling system in the game; I'd say at least 90% of the anime characters would get rekt. Protagonists would have optimized teams of their choices, while the likes of Ash would be severely restricted by not being as out of the box with their strategies. However, the characters that were shown to utilize competitive strategies in the anime would most likely do pretty well; Conway with his Trick Room Dusknoir and Power Trick Shuckle, the frontier brains in general, Volkner, and others.
In general, I think that thematically there'd be no way to beat the protagonists in virtue of how ridiculously OP they are, but realistically I can see the aforementioned Conway, frontier brains, Volkner, and Paul, who showcases traits of competitive players who know what they are doing, would have high chances of beating the protagonists that were relatively limited in comparison to others, like Gen 1 - Gen 3 protagonists, but from that point on, I'm not sure if they'd win.
I might be giving too much credit to the games, I might be underestimating the anime characters, I dunno, but that's just how I view things between the games and anime.