As Theresa May’s motorcade swept across the causeway to Osaka airport, where her grey official plane was waiting on the runway in the stifling heat, she passed one more milestone on the humbling journey from No 10 to the backbenches.

This weekend’s G20 was the prime minister’s final major international summit – though she curtly reminded journalists that she still had an EU council and a meeting about the western Balkans to attend before she bows out.

For three more weeks then, she will retain all the trappings of office: the entourage of razor-sharp advisers, the country residence at Chequers, the Downing Street flat. But very soon it will all be gone.

En route to Japan, her aides briefed reporters that she was not yet ready to answer backward-looking questions about her turbulent three-year premiership – let alone anoint a successor, as Boris Johnson and Jeremy Hunt vie to succeed her.

Instead, asked about how she was feeling, she slipped into pure Maybot, saying: “My mood is one of determination to carry on doing the job that I’m doing and to ensure that I get some very strong messages across to those I’m meeting.”

One recipient of such a message was Vladimir Putin. She took the opportunity to rebuke him, face-to-face and at length, over the Skripal poisonings – the pair first posing sternly alongside each other for a photo, May wearing a glower one unkind colleague said looked as though she had practised it in the mirror.

Seasoned observers of May’s approach say she is often at her best when under attack – and the aftermath of the Salisbury attack, when she rallied international support for reprisals against Russia, was one of her few moments of genuine diplomatic influence.

But Putin warmed up for his encounter by trolling May, with an outspoken Financial Times interview trashing liberal democracy. As the prime minister exits the global stage, she leaves it dominated by a motley cast of populist strongmen – Putin, Donald Trump, Turkey’s Recep Tayyip Erdoğan and Brazil’s Jair Bolsonaro.

Theresa May with Donald Trump in 2017. Her exhortations fell largely on deaf ears Photograph: Rex/Shutterstock

The vicar’s daughter who let off steam by running through wheat fields could not be a more different character. Yet in the optimism of her early days, when she was so confident of her public appeal she posed for a photo shoot in a £995 pair of brown leather trousers, May and her team hoped they could influence Trump and even ride the wave of brash optimism that swept him into the White House.

She was the first world leader to visit him there, just a week after his inauguration, in January 2017.

In Philadelphia en route, May dropped in on the Republican convention and gave a speech suggesting the US and post-Brexit Britain could “rediscover our confidence together”.

It was intended as a clever bit of political framing by May’s team, then still led by the mercurial Nick Timothy and Fiona Hill. She name-dropped Margaret Thatcher and Ronald Reagan, whose relationship as cold war warriors was known to be warm.

But she also praised the multinational institutions of which Trump is instinctively suspicious, pointing out that Britain and the US worked together to build them in the aftermath of the second world war – the United Nations, Nato, the World Bank.

“It is through our actions over many years, working together to defeat evil or to open up the world, that we have been able to fulfil the promise of those who first spoke of the special nature of the relationship between us,” she said. “The promise of freedom, liberty and the rights of man.”

It was a signal that while May hoped she and Trump would get on – coyly telling journalists “sometimes opposites attract” – she also hoped to remind him of the US’s critical role in the world. Yet the abiding image of that trip became the awkward moment, caught by the cameras, when Trump reached out and held the prime minister’s hand.

By the time May’s plane landed in Ankara for a meeting with Erdoğan at his gaudy palace outside the city, Trump had signed what became known as the Muslim travel ban, stopping the citizens of seven countries entering the US – hardly embodying the “values of democracy and liberty” she had lauded in Philadelphia.

Even then, May’s exhortations to the erratic Trump fell largely on deaf ears. But during the next two years, as her premiership advanced into ever more troubled waters, her ability to influence friend and foe alike drained away.

Japanese TV viewers wanting to catch up on who was in town for the G20 were treated to a memory-jogging montage, showing the coughing fit that seized May during her 2017 party conference speech – and Philip Hammond leaping up to hand her a throat sweet.

At the conference centre, during a photocall for EU leaders, who had been locking horns over who should fill the institution’s top jobs, May shuffled awkwardly to find a place to stand, in an excruciating visual metaphor for Britain’s half-in, half-out status.

Her unashamed lack of clubbability has frequently made her appear somewhat isolated at EU gatherings – though she shared a hearty laugh with Angela Merkel earlier this year, when they were both wearing suits in the same shade of bright blue.

In another life, in which it wasn’t May’s allotted task to take Britain out of the EU, these two no-nonsense women of the centre-right might have become political friends.

Theresa May and Angela Merkel: in a different world, these two might have been political friends. Photograph: Reuters

Instead, at summit after summit as the Brexit talks twisted and turned, May was sentenced to be the lonely human face of British exceptionalism, dispatched to dine with her aides at the British residence, while the EU27 carried on their discussions without her.

Even if Brexit had gone smoothly, the task of recalibrating Britain’s place in the world as an ex-member of the EU would have been a challenging one for any prime minister. But hemmed in by a rebellious cabinet and a divided party, in a hung parliament, May has had little time to practise geopolitics, aside from shuttling back and forwards to Brussels.

When she does make it on to the summit circuit, her moderate message of international cooperation and respect for the “rules-based global order” has often appeared out of step with the moment – and with Britain’s own political direction.

She has been defined in the world’s eyes by the hashed project of withdrawing from the EU – but on Saturday, alone on stage in the bright white press room in Osaka, she said: “We have always understood that our success as a nation is tied to our collaboration with other countries and the relationships we build.”

Her loyal husband, Philip – an integral part of May’s political project from the first moment to the last – looked on from the front row.