I think China also has another problem. They're not that great at exporting soft power. Sure, their skill at leveraging economic dominance is pretty good, but they're an incredibly insular culture compared to Spain, France, Britain, or America. China's external culture power is honestly pretty low, and I'm not sure they have the societal values to grow it unless there are major changes. Without that, could it truly claim geopolitical dominance? And if Chinese economic growth does stagnate, what do they have left if there's not high culture power?
While China itself is poor at exporting cultural capital, its people have many historical links with countries across the world, old and new, both from before and after it went from being all under the sky to just another nation amongst nations. The North Americas, South Americas, Europe, SE Asia, S Asia and a great deal of North and South Africa can boast communities of various Chinese cultures, continually boosted by China's high rate of emigration, students, workers and businessmen. Thus while it does not boast the big brands and influences of French fashions and American superstars, there is a preexisting international network of culturally similar communities that diffuses Chinese cultural exports. The Chinese government also does fund projects to export its culture, most notably with the Confucius institute, but I haven't seen that be as successful yet as its relative counterparts in the USA or Europe. Very much a WIP, to quote an Indonesian, ancient China is awesome, but modern China sucks
There's also another issue. The age of colonialism permitted the forceful spread of Spanish, French, and English all over the world.
Also notably was that within the respective European Empires, not only were schools set up teaching those languages, but as trade within respective European Empires was until the turn of the 19th-20th centuries, conducted within Empires exclusively, no other languages could compete
Mandarin both is of an entirely different language family and uses a different written form, not even just a different alphabet. It was way easier for Spanish, French, and English dominance to pass between one another than it would be for it to pass from English to Mandarin.
It wouldn't be too hard, especially given China's standardization of language and pinyin, well, at least not harder than learning foreign languages already is. I imagine the greatest difficulty is in the sheer difference of grammar, with sentence structure and one verb form acting as all forms of that verb without conjugation for example being the immediate challenge. More than that though, is that languages like English have been the language of two consecutive world hegemons, whose languages have been taken up by shed loads of people. This creates a large, fluid network, which in turn encourages more people to take up the language. Anyone who learns English may never need to nor wish to visit an English speaking country, it will be sufficient to be able to speak with 2nd language English speakers, of whom vastly outnumber native English speakers and are spread on a vastly larger scale across the world. To use an example of the past, I once had a sensible chuckle reading an account of an English prince who, having learned French, tried speaking with a French diplomat in his own tongue. However, his accent was so incomprehensible, that they simply spoke in Latin instead. English is this bastard hydra that outgrew the control of the USA 40 years ago and the UK 100 years before them, now there are many Englishes all across the world. In the future, I find it is more likely for English to become a family group of languages, than for "THE" English language to be replaced
inb4 future communication is interpreted not with language, but ironic dance routines and minimalist cave paint memes