You could buy that Ash in that series was starting to surpass them again but at the same time Clemont and Serena suddenly started trouncing them like they were nothing as well.
Serena didn't do it herself, she was more beating them in combined effort with Ash and Clemont. As of Clemont that makes sense since he's a gym leader like 5th one. So makes sense that he's beating them.
I think the issue there is that they hadn't really regained all their comedic charm and versatility to compensate for it until SM, so late XY TR were just doing their old curbstomp shtick but blander and more repetitive, and even worse XY was the one post-DP point they oversaturated their use again.
The only two issues here are that XY TR didn't catch at least 1 more Pokemon each and that they should've stayed BW menacing like, they've would've been best TR ever. TR's comedic entries are gone with the wind. OS-AG should've been only comedic TR while their more "menacing" ,"evil" breaking point should've been DP. That's why Pre-Unova League TR is is the best, they are acting like real, "dark-leveled" team that other teams are doing per series. XY stuck with that even as being jobbers, they were presented with that evil "aura" while in SM it was gone, thanks to a nature of series which was more light-hearted and comedic. They reverted to being comedic which doesn't suit their progression. OS-> AG -> BW S1-early S2 TRio is the real progression of their characters that's why it was such bummer that they reverted to be "comedic", less dark version of themselves post Unova league, still menacing( especially in XY). That's why XY > SM Trio for me.
"but they were used more reasonably and their roles in episodes were more versatile and vibrant"
You're speaking more from character-driven points of TRio (which deserves different rating) but I am talking about menacing-dark driven points(also their competence, battle progression characters), which make sense since that's what I favor( battles over reference/continuity).
I would rather see TR giving good fight for Ash and doing dark level things rather than watching TR for example in that Ditto episode in PM or like having "cute" goodbye moment with Mimikyu, Bewear( in last episode of SM), or Jessie having comedic argument with Matori in Spying for the Big Guy.