I really do not see Ash losing this battle at this point. Leon's character arc practically demands that Ash defeat him, as his character is all about how being undefeated has been stressful to him, and he's waiting for someone to surpass him and break his undefeated streak. It mirrors his arc in the games, as his character arc there culminated in him ultimately losing to the protagonist, and in this case, Ash is that protagonist who has the duty to break Leon's winning streak.
It would be an ungodly stupid move to have Ash lose to Leon after they've been building this battle up for the entire season, Leon is Ash's ultimate rival-goal for Journeys, and this battle is the ultimate climax of JN/PM19. It would also be a ridiculous low that I don't think the anime would be willing to sink to. Yes, I know Ash has lost most of his League Tournaments over the years and is notorious for that, but he has almost never lost his climax battles with his main rivals.
In OS, not counting the Indigo League for obvious reasons (Ash's whole thing back then was being a loser that no one liked) his main rival at the time was Gary, and Ash vs. Gary was the climax rival battle in the end that they were building up to at the end of the Johto League. The end result was that Ash defeated and surpassed Gary, ending their rivalry and also being a conclusion to Gary's character arc and being the catalyst for his character to change direction from that point. After that battle in the Johto League they then introduced a last minute plot device in the form of Harrison who had the purpose of promoting Hoenn and also having the explicit purpose of eliminating Ash from the League. There was no build up for Ash vs. Harrison.
In AG he had no real rivals in Hoenn so that was whatever. He did however win the Battle Frontier during that season and the "final boss" of that was Brandon, and Ash won against him.
In DP, Ash's main rival was, of course, Paul. Over 100+ episodes of a bitter rivalry, a clash of beliefs, coming to a head in the Sinnoh League. Ash vs. Paul in the League was the big climax they were building up towards, and it ended with Ash winning, especially at the end with Infernape vs. Electivire, Infernape being the Pokemon Paul gave up on, but then Ash took for himself and trained, and it ended with Infernape unleashing its true power with Blaze and then defeating Electivire and by extension winning the battle for Ash, finally bringing Ash and Paul's bitter rivalry to an end and Ash earning Paul's respect. Ash then lost to, lo and behold, a last-minute Deus Ex Machina in the form of Tobias, who was an asspull they created last minute for, you guess it, the explicit purpose of eliminating Ash from the League after he defeated Paul. Again, he defeated his main rival, but then got taken down by a Deus Ex Machina character who appears last minute and has no buildup.
BW is a case that's weird to talk about because the Unova League was just a really big "fuck it" writing moment, but I guess you could say there was...LMAO Trip as a "main rival" to Ash and Ash still did defeat him, albeit in a laughable 1v1. But as usual he lost to a last minute "guy who shows up to defeat Ash" and this time in a laughable manner against a guy who didn't know how to count and only brought 5 mons to a full battle. Embarrassing. Either way the case still applies. Deus Ex Machina character who shows up last minute is the guy who defeats Ash.
And then you have XY, which is a bit of an unusual case, but it still worked. This is the only time Ash actually lost to his "main rival" so to say, who is Alain, albeit in a very close battle. But in this particular instance while the loss was upsetting it at least still worked narratively because the Kalos League was ultimately building up to the Team Flare villain arc, which gave a place for Alain, Ash, and Greninja's character arcs to actually reach their conclusions. Ash and Alain's rivalry was more narrative, putting it bluntly. Ash through battling Alain taught the latter how to truly have fun battling again, and Alain being the powerful opponent that he is gave Ash and Greninja the push they needed to be able to fully master the Bond Phenomenon and Ash-Greninja which they spent several episodes struggling with. Even though Ash lost that battle, both of them enjoyed the battle and Ash-Greninja fully mastered its power, and then that led up into the Team Flare arc which gave the proper conclusions to Alain's character arc, as Ash helped Alain through the guilt he felt about being manipulated by Lysandre, Alain had his "redemption arc", and Greninja found its true role as a protector of Kalos. So in a sense that villain arc gave a way out as it still gave a place for everyone's arcs to reach a proper conclusion.
And of course, there's SM where as we all know, Ash finally won a League Tournament for the first time. No Deus Ex Machinas to get rid of him, Ash beats his main rival and wins his Full Battle against the guy who was practically his father figure in Alola (Kukui), none of that.
---
I ranted quite a bit repetitively above, but hopefully you see the pattern. Given what I've outlined here there is zero good reason to have Ash lose to Leon here. Leon is not a last-minute Deux Ex Machina plot device designed for the sole purpose of eliminating Ash like Harrison or Tobias. He's a proper "rival" character in the lines of Gary, Paul, and Alain. A full-blown character who has a character arc of their own, and in the case of the former two, their characters came full circle when Ash defeated them in the League. And unlike Alain, they have no excuse to make Ash lose in terms of Leon's character arc, it's not like Alain where they had something afterwards, and Alain's character arc still had somewhere to go to be able to reach a proper conclusion.
In this case Leon's character to be able to come full circle practically demands that Ash defeat him. His arc is all about him learning he can lose again, that he can be surpassed.
If Leon wins again, then he effectively has no character arc. His character arc goes nowhere.
He just...stays unbeatable. He stays in the exact same place he started at the beginning of Journeys.
That is not how you conclude a character arc. Especially after you spend an entire season building up this particular battle.
I really don't see Ash losing this. If he does, that would be character assassination for Leon and make all the buildup we had to this battle amount to nothing. Given what I outlined I really don't think the anime writers, as dumb as they can be at times, would be dumb enough to sink that low for this battle.