I disagree. Ash is trash. It took him 21 years to finally win a real championship. On top of that, he did it in a Pokémon League that wasn't even developed yet. How is a character that has been losing every match that counted for the past 20 years a "good character?"
While I'm not particularly fond of Ash either, I don't think you're doing a fair comparison here.
Even if we ignore the fact that counting the time it got him to win a championship when God (the writers / producers) was pretty much pulling strings to see him fail and that any other character would also fail in that situation, is a bit weird, there are some other things to consider here.
In Kanto, Ash lost because he was a newbie trainer that didn't have the respect of Charizard.
In Johto, Ash lost to a more experienced trainer who was advertising the next region. That's both an example of God pulling strings (the production team had a vested interest in letting Hoenn shine since it was the next region and they need to market that / write a reason to let Ash want to go there) and a sensible loss (Harrison was just more experienced).
In Sinnoh, Tobias happened. That was blatant writer intervention and we all know it. Nobody was expected to be able to beat a team of legendaries in the anime. The fact that Ash managed to beat one was already enough of an accomplishment since iirc nobody else managed to do it: Tobias beat all of his other battles in clean 6-0 sweeps (outside of Cynthia / E4, I guess, since he isn't the Sinnoh champion).
In Kalos, Ash was a runner up against Alain,
one of the Top 8 trainers in the world as of the current season, in a controversial loss that many feel is due to writer intervention. But even if we disagree regarding that, only narrowly losing to a Top 8 trainer in the world, is not a bad performance at all.
(Ash also won in the Orange Islands btw, so he didn't lose every time it mattered.)
Also, we need to consider that Ash was effectively challenging himself for most of those regions. With the exception of Johto and the Orange Islands, he started from (almost scratch) every time while his opponents presumably kept the same team since forever, give or take a few changes. Being able to retrain a full team of Pokémon from zero in time to the tournament and do reasonably well is in and of itself an accomplishment.
So really, with the possible exception of Hoenn and Unova, most of those losses are either expected within the story, and the ones that aren't have some specific circumstances to them that go away when you only say "It's a loss".
Ash isn't a real person and so he isn't the master of his own destiny. He still ultimately has to do whatever the writers tell him to do, and considering the major plot of the anime for the first 6 or so regions was "Ash is going around the region to prove himself and become a Pokémon Master", having Ash prove himself and become champion would more or less conclude Ash's story arc.
The problem is that the anime doesn't want to conclude Ash's arc because he's iconic and having to start over with a new protagonist (and a new mascot, unless the new protagonist, also used Pikachu) would be losing a lot of brand awareness. In fact, it could be argued that the only reason Ash was allowed to win the Alola championship was because fans were extremely pissed that he lost Kalos' and so the producers decided to throw the fanbase a bone.
But none of that really matters because:
As for Goh, he has caught a total of 117 Pokémon, all in one anime series, whereas Ash only caught 83 throughout his entire 20+ year existence. I'd take Goh over Ash any day of the week. However, I don't necessarily think it has to be Goh that replaces him. I just feel that the anime would be better off with Ash gone period because he sucks.
This reeks of a "Line goes up" mentality which is a bit uncomfortable when applied to character and media analysis.
I could talk about how Goh catching a Pokémon is treated very differently than Ash catching a Pokémon, so Goh has the writers on his side and Ash doesn't.
I could talk about Ash never really wanted to catch a lot of Pokemon to begin with (his goal is to become stronger, having quality over quantity is a perfectly reasonable strategy) so this is a baseless comparison to begin with.
But the main problem I have with your talking point is that ... those numbers don't really mean a lot when people are talking whether a character is good or not? It completely ignores story arcs, decisions, personality, whether they're hated or loved by the writers, character design and so on.
You're saying something analogous to "Kakashi has used at least 1000 ninja techniques throughout the series while Naruto only learned 6 or 7, so Kakashi would be a better protagonist than Naruto, who sucks." or "Goku has a power level of 10,000 while Gohan only has a power level of 6,000, therefore Goku is a good character and a better protagonist than Gohan, which is a bad character." or "Josuke needed a kid to help him beat his protagonist while Giorno didn't really, so Giorno is a better protagonist than Josuke."
Those statements all make comparisons that seem like they'd be meaningful at first glance, but aren't really. Kakashi would never be able to do half the things that Naruto did, Goku and Gohan are both popular protagonists with different arcs and Josuke had a vastly different villain to beat compared to Giorno and that kid being there made for a more compelling resolution to the story than the way Giorno dealt with his villain.
A character can be more successful than another character in a given metric but that doesn't mean they're better, it just means they do better in that given metric. A character who loses can be a more compelling and beloved character than someone who wins all the time, as an example, most people would take Jesse and/or James, who exist to lose, over Tobias, who has never lost, any day of the week because Tobias isn't a good character despite winning.