I feel like a character can last if they have some sort of chaining point they can keep playing into. Development hasn't exactly been plentiful in SM...like at all sometimes, but they have experimented a little with giving some of the cast star appeal to work in a more stagnant premise.
I think Kiawe, Lillie and Sophocles are the ones who best survived the erratic handling and pace because they were the ones besides Ash that the writers at least managed to establish a core for, they have a signature flaw to keep expanding upon and highlighting in their focus without being too much of a one note running gag, while they also have at least some sort of basic niche, even if it's only delved into so often. These basics can be branched out into all directions like chemistry with Ash and their Pokemon, agency in multiple situations (notice they always stand out the best in ensemble episodes like the UG missions) and just contributing to the general comedy. In most sports episodes for example you can get signature gags out of their vices, without just diverting into being the exact same gag over and over. I think the fact that they have managed to keep linking to these elements to some degree in their episodes does at least appeal to a subtle character arc.
Mallow and Lana however are completely lacking in those core traits, they don't really have any personality flaws (quirks maybe, but not really developed enough to be hinderances) and their niches are far too obtuse and underdeveloped to really integrate into group situations as VoltTacklingPika noted. Most of their big moments of usefulness are just waiting for Ash to get worfed and then curb stomping whatever lame baddie there is without much developed effort or strategy, which means even less when they aren't even battle centric. Even within the slapstick they're the most rarely targeted because their lack of flaws makes it less fun to undermine them. They 'get things' like Eevee and Shaymin but despite their fanfare, they haven't really improved their agency the same way the others' tune ups have. They feel incredibly bland and complacent characters, even by the standards of some previous companions. Lillie sometimes zigzags into the 'neutral female' syndrome as well (as I noted in the upper comment, though we've had some character checks since then thankfully), but she gets plenty enough fully fledged exceptions to consider her having 'clicked' to some degree, she at least doesn't always fade into the background in the group episodes, which kept her going to some degree post-AF arc.
I admit I liked the sort of running theme with the other four companions, the whole 'big fish in small pond' motif, they all had a niche but whenever they were out of their element they were hopeless and their weak points were obvious. That's easy to make fun and depthful and also adds this nice tint of humility to them that's not always seen with the anime. Despite the usual very obvious cases of plot armour it nearly always feels like those four have to TRY to accomplish just about anything. I don't really get this with Mallow and Lana however, they keep to one very obscure talent and are never really taken out of their comfort zone. They're not exactly remarkable but there's almost this instinct with the show to persistently siddle around making them 'losers' at anything, which is what makes the other four so sympathetic. How can you reach a top if there was no bottom to begin with?
My overall feeling about them is that while the writers are tied-up by the long form format, they didn't help themselves. Some great work has been done on these characters, but I wish it was tied into the overall narrative of the show better. As it is, it feels very fragmented. Too much of the progression is done in isolation, when I feel that every step that the characters take should have a knock-on effect for someone else, especially in a cast as big as this one.
I feel like, at the very least, they got that right with Ash's team a lot of the time. Unlike most previous series a lot of his rivals aren't just there for that sake, they start as such and then branch out as their own characters with their own individual limelight. They also are well set out in all being rivals to an individual member of Ash's team in particular, balancing them a little in limelight. A lot of the best handled companions are also those that click a good chemistry with Ash, and in most case he does something to set about branching out of their comfort zone with them slowly taking steps independently afterwards. He isn't all encompassing but he does the job well as a foil and world building mechanic.
Take the chain reaction development starting at Akala for example. Rockruff evolves into Lycanroc, Litten gains a rivalry with Lycanroc from him being bigger and resultantly trains, giving way for Masked Royal and Incineroar to debut as personal rivals, and for them to chain off Litten's evolution into Torracat while slowly getting weaned into their own limelight (first through a mostly Torracat episode, then a Torracat/Incineroar duo episode, then a mostly Incineroar episode). That was a decent methodical approach to developing multiple characters.
Many companions also sort of had a starting point caused by Ash, who is naturally more on-the-fly than them. His training with Kiawe chained off his ongoing attempts to become a versatile battler, sprucing up Turtonator's battle style and catching Marowak (who definitely added spice to Kiawe's team), while he got Sophocles Charjabug, which gave him some sort of dynamic focus bonding and raising a new Pokemon, giving him motive to hang out with the guys in more episodes and break from his sheltered kid lifestyle. Lillie was the more flourished 'mentored little sibling' example, being inspired and supported by Ash multiple times, though also having less direct but pivotal cases like getting her Snowy's egg or Nebby culminating her phobia arc.
In fact most of the characters failing to leave a mark this series seem to be the odd few that Ash fails to gain a chemistry with (Team Rocket are actually making effort to be relevant personal rivals for once for example, but since Ash and his team stonewall all of it, with the writers seldom investing any good face offs or interactions between them, they remain just another jobber bad guy, while, again, Mallow and Lana lack much of flaws or weak spots, so unlike the others there wasn't really a key moment a chemistry with Ash clicked an ongoing dynamic with them, he helped Lana get her Waterium Z I suppose, though that didn't really end up helping define her role).