Z-9 will continue on serving on ships with smaller flight decks, those that anything bigger than Z-9 would not fit to operate.
Still, it's hard to imagine that the Super Frelon bloodline can live on this long, when everywhere else outside China it has long been replaced.
I actually wonder about the footprint and hangar space necessary to support a Z-9 vs a Z-20. I think there is a chance that ships which field Z-9s (and Ka-28s incidentally) may be capable of fielding a Z-20 as well.
As for Super Frelon longevity, that is true to an extent but it isn't alone. Ch-53K is the latest variant of the Ch-53 family whose original first flew in the early 1960s as well, not to mention Chinooks.