What makes so many writers so sure the USA and other Western governments will still be going strong in the 22nd, 23rd and 24th centuries?
I don't think they are. Most of Trek tried to simply stay away from Earth as much as possible, with TNG
occasionally dropping hints about large regional states (like the "European Hegemony") leading eventually to "world government." The implication in most of what we do see is that nations haven't entirely stopped existing but have gathered together under the Federation umbrella. But it's all kept pretty vague AFAICS.