It was a symbolic moment. High in the Swiss Alps, before an audience of the super-rich gathered for their annual shindig in Davos, China’s Xi Jinping delivered a powerful defence of globalisation. Protectionism, he said, was like locking yourself in a dark room. “While wind and rain may be kept outside, that dark room will also block light and air.”

On that January day nine months ago, the target for Xi’s comments was more than 4,000 miles away on the other side of the Atlantic, preparing for his inauguration as president a couple of days later. The message was simple: if Donald Trump is going to turn his back on the world, China will fill the vacuum.

The Davos elite lapped it up, putting to one side any misgivings they might have had about Xi’s increasingly authoritarian rule, the purges of his opponents and the tightening of censorship. Xi might be the leader of an illiberal one-party state, but he talked the language of open markets and free trade. Unlike Trump, with his walls and punitive tariffs, this was a man with whom they could do business.

The US has its weaknesses too, and Trump’s tough guy act should fool nobody. It is unlikely to impress Xi

Both sides of Xi have been in evidence in the months since. This week he tightened his grip on power in Beijing, becoming the most powerful Chinese leader since Mao Zedong. But his tough line on anything that smacks of dissent at home has been matched by a much softer approach overseas. Where Trump has said the US will pull out of the Paris climate change deal, Xi has said China will stick by its commitments. While Trump has cut the US aid budget, Xi is delivering big infrastructure projects to poor countries with no questions asked. Trump has rejected the World Bank’s plea for more money, but Xi’s shiny new Asian Infrastructure Investment Bank (of which the UK was a founder member) has deeper pockets and is only too willing to lend. Trump wants to kill the North American Free Trade Agreement between the US, Canada and Mexico; Xi says the global economy is a big ocean from which no country can escape.

China has some serious problems. A pollution crisis helps to explain why it is backing action to tackle global warming. The one-child policy, which ended in 2015, means its population is ageing long before it has completed its transition from developing to developed status, a trend that will slow long-term growth. In the short term, China has only been able to sustain annual growth rates of 6-7% by pumping the economy full of debt.

The International Monetary Fund has identified the pricking of China’s credit bubble as one of the big risks to the global economy, but it is also a domestic threat to Xi because a marked slowdown in growth would lead to rising unemployment and political unrest. But the US has its weaknesses too, and Trump’s tough guy act should fool nobody. It is unlikely to impress Xi.

Seventy years have passed since the IMF opened its doors for business and France became the recipient of the first loan made by the World Bank. Washington took the lead in constructing a series of multilateral institutions designed to prevent a repeat of the economic collapse and extreme nationalism of the 1930s. American economic muscle meant that, by and large, what the US wanted, the US got. That is less true today, but America still has real clout at the three big multilateral economic institutions: the IMF, the World Bank and the World Trade Organisation. But only if it chooses to use it. Trump has chosen not to.

‘The Belt and Road initiative is a massive commitment.’ Tashkurgan where one of China’s highest altitude airports will be built as part of the Belt and Road initiative. Photograph: Tom Phillips/The Guardian

In 1947 the US also announced the Marshall plan to help to rebuild the devastated economies of western Europe. America was much more generous with its aid 70 years ago, but the plan was not just about charity. American companies needed consumers overseas to have enough money to buy their products, and Harry Truman wanted to tie the recipient countries in western Europe into a military alliance to counter the threat from the Soviet Union.

The modern version of the Marshall plan is Xi’s Belt and Road initiative, which finances infrastructure projects across Asia. The belt runs along the old Silk Road and the maritime road stretches across the Indian Ocean to the Mediterranean via the coast of Africa and the Suez canal.

As with the original, this is not pure altruism. China’s recovery from the financial crisis of a decade ago involved the state spending money on industrial capacity the country did not really need. Sending steel and cement overseas keeps Chinese factories open and workers happy.

The Belt and Road initiative is a massive commitment, dwarfing the Marshall plan in size and scope. Countries do not have to join a military alliance with China to benefit, but the expectation is that they will inevitably develop stronger trading and political links as a result. Under Trump, the US appears to have lost its knack for deploying soft power; Xi has shown how to do it.

America is not finished as a global power, or even close to being finished. China has a long way to go before it can match the US on income per head of population and military spending – the indicators that really matter. Those who have predicted the demise of Uncle Sam down the years have been proved consistently wrong.

But nor is this a repeat of the late 1950s, when Nikita Khrushchev’s space programme prompted needless panic in the US that the Soviet Union’s economy was forging ahead. China’s stupendous growth means it has been able to deliver the improvements in living standards that were denied to Russians during the cold war.

More than 500 million people have been lifted out of poverty since Deng Xiaoping began China’s economic transformation in the early 1980s. Bicycles have been replaced by cars; consumption of dairy produce is up because people can afford fridges. Pictures this week of young women in Tiananmen Square taking selfies with their smartphones made the point: Beijing in 2017 is not Moscow in 1957. China, after transforming itself from an agrarian into an industrialised economy, is now eyeing up opportunities in the hi-tech sectors that the rich countries of the west once considered their own.

In America, the days when John F Kennedy could boast that a rising tide lifted all boats are long gone. Trump is president because the economy grows only half as quickly as it did in the immediate postwar decades and the fruits of that growth have been captured by a privileged few. It is not as easy as it once was to make the contrast between an authoritarian regime that doesn’t deliver prosperity and a liberal regime that does.

China is mounting the first global challenge to the US since the collapse of the Soviet Union more than a quarter of a century ago, and a far more meaningful one at that. Trump, a throwback to America’s isolationist past, is making that threat more potent by rejecting the multilateral system that previous occupants of the White House had crafted and dominated. For four decades, China has focused on the domestic challenge of growing the economy. During that time there has been endless speculation about when it would start to claim a bigger role on the world stage. That moment has now arrived.

• Larry Elliott is the Guardian’s economics editor