Ever heard the phrase "Socialism or Barbarism"? Marxists don't believe socialism is an inevitable result of the end of capitalism. Socialism has to be built, the entire theory of Marxism is that we observe the history of the world (i.e. the history of class struggle) and, rather than waiting around for history to happen on its own, we intelligently act on historical forces and cultivate a better world we want to live in.
If we just wait around for capitalism to collapse on its own, i.e. wait for what comes after late stage capitalism, we might all die.
Capitalism could very well collapse into a post-apocalyptic hell where a few million survivors huddle around the poles to survive.
Or just a nuclear war and total human extinction. Or a fascist Mars colony where only the elite are allowed to escape Earth. Etc.