Currently, that may indeed be the case, but I suspect that it's the case for the vast majority of nations on Earth that they're not longer individually sustainable if suddenly isolated. That isn't to say that said nations couldn't come to some measure of equilibrium given a few years to adapt to the sudden lack of incoming resources.
I'm one, as well, for the idea that any world government is going to come as the result of alliances, unions and commonwealths between nations--adding another layer of governmental abstraction instead of subsuming that which existed before--than just one monolithic society or some fantasy world where *insert favored nation here* beats everyone into submission in some imperialistic fantasy planet.
This holds especially true for something like the Federation. What glimpses we have of the inner workings of the Federation government are that the individual planets are there by choice. They aren't compelled or coerced into being part of it. It's just in their best interests to be in it. The Federation doesn't seem to conduct itself in an expansionist way that the various 'Empires' do, using their assorted militaries to forcibly acquire territory and spend even more to keep it subjugated. In the ST world, this philosophy seems to be the right one, as it seems somewhat implied that the Klingons, Romulans, and the Cardassians, even in their heydays, couldn't stand toe to toe with the Federation, quite possibly because too many of their internal resources were expended on maintaining their own internal dominion of subjugated races and planets, while the Federation could focus the entirety of their efforts on improvement and expansion... a little utopian and possibly naive from a narrative standpoint, yes, but in that world, it seems to work.
I imagine that a similar effect will eventually necessitate a future World Government. It's advantageous for countries and nations to work together to do that which would be prohibitively expensive, redundant, or impossible for individual nations to do, especially for endeavors that would have a global impact. As a result, other nations will join in, especially if said alliances manage to weather adversity and hardships in a way that benefits its members overall.
Even in the 24th century, it seems that individual nations still exist. Picard is from France, Riker is from Alaska, Kirk was from Iowa, Worf was raised in Russia (the Ukraine, more specifically, I think), etc. They didn't say that they were simply from Earth. Obviously they felt their nations of origin were important and distinct enough to use as personal identifiers, as well as implying that said areas still retained their own distinct and viable cultures. Yeah, government extends beyond the national level, but that doesn't mean that nations don't exist, just as the existence of the US national government doesn't obviate the existence of individual states or counties or that the EU doesn't eliminate the existence of its member nations or their own subgovernments. It just means that they're adding an additional level or government to maintain the shared transnational and potentially global infrastructure required to continue our economic and technological progression.