Sir John Major has prepared the way for a British defeat over the appointment of Jean-Claude Juncker as European commission president by saying that EU leaders would make amends if David Cameron lost out.

As the prime minister pledged to fight the appointment of Juncker "right up to the end", Major said the EU might choose the wrong candidate for the wrong reasons.

But the former prime minister said the EU would then seek to "make that right" by helping Cameron when he starts to renegotiate the terms of Britain's EU membership. This would help the prime minister to win a yes vote to keep Britain in the EU in his planned in/out referendum in 2017.

The intervention by Major, whose occasional contributions to political debate are designed to help the prime minister, indicates that Downing Street is giving careful thought to how to respond to a defeat over Juncker. Britain is expected to suffer a fresh setback on Wednesday when Matteo Renzi, the reform-minded prime minister of Italy who had expressed concerns about Juncker, will demand a relaxation of European austerity policies in return for agreement on the appointment.

Major, who said he had "no animus" against Juncker, who had made a "very fine prime minister of Luxembourg", suggested Britain was heading for a defeat. He told the Today programme on BBC Radio 4: "I don't know how it is going to turn out with Mr Juncker. I do not think he is the right candidate. But it is conceivable for the wrong reasons that Europe might elect the wrong candidate."

But the former prime minister said EU leaders would seek to make amends if Juncker was appointed. Major said: "If that is so the way Europe often works is if it has done something that is very much not to the interests of a particular country they often seek, both subliminally and publicly, to make that right in some other way. The question is: can we get a satisfactory negotiation along the lines Britain has been talking about? My answer to that is categorically yes, we can.

"We are not alone in seeking reforms. I often found that when I appeared to be battling on my own for some change in Europe that after the battle had been fought, whether I had won or whether I had lost, I often found I had allies I didn't know were there who hadn't always spoken out.

"I think there is sufficient common interest in terms of common interests across Europe for alliances to be formed when the negotiation proper starts. I genuinely believe David Cameron will be able to come back with a successful, significant reform package that will enable him to put that before the British nation and for Britain then to vote in a clear-cut way to stay as a member of the EU."

Cameron's intervention, during a press conference with the Chinese premier, Li Keqiang, came amid a growing feeling in Downing Street that Britain faces a tough fight to block Juncker, who is the lead candidate of the European People's party, the main centre-right grouping in the European parliament. European leaders are due to discuss Juncker's prospects over dinner in Ypres, originally designed to mark the centenary of the first world war, on Thursday next week.

Britain's isolation will be highlighted when the Italian prime minister meets Herman Van Rompuy, the European council president, who chairs next week's summit and is mediating between EU national and parliamentary leaders over the Juncker question. Renzi and the French president, François Hollande, both on the centre-left, are demanding more time to reduce their budget deficits and want certain categories of public spending exempted from deficit-level calculations.

"That's Renzi's condition for agreement on any [commission] candidate," said Hannes Swoboda, outgoing leader of the social democrats in the European parliament. "Van Rompuy knows he has to give Renzi an answer."

Cameron made it clear he would not cut any deals as he moved to smoke out Angela Merkel, who shares his concerns about the process that has made Juncker the frontrunner. The German chancellor moved decisively in favour of Juncker after Cameron reportedly told the last EU summit that his appointment would increase the chances of Britain exiting the EU.

Cameron said: "My view is very clear. It is for others to make their view clear. If you are for reform then you need to stand up and fight for reform. If you are against transferring power from the European council to the European parliament, you have to stand up and say so."

Downing Street has not given up on blocking Juncker, although it admits it faces a difficult challenge. "The die is not cast until EU leaders meet next week," one source said. "But it will be tough."

Cameron appears increasingly isolated in what has become a shrill campaign to try to stop Juncker. Merkel is said by senior diplomats in Brussels to have decided against Cameron and for Juncker. London's main hopes of blocking Juncker hinge on Renzi, but the chances look slim.

Van Rompuy is expected to include language in his policy blueprint that would allow Renzi to claim victory. In return, the Italian leader, who emerged as the big winner of the European elections, would agree to join the majority at next week's summit, which looks increasingly likely to nominate Juncker for the commission post despite Cameron's bitter opposition.

Cameron's anti-Juncker campaign has peaked over the past week and shown him to be relatively isolated. He spent two days in Sweden with the German, Dutch and Swedish leaders, where Merkel rebuked him for delivering threats about a UK reaction to a Juncker appointment.

At a dinner with the 27 other EU envoys in Brussels, Ivan Rogers, the UK ambassador, delivered a broadside against Juncker, reiterating warnings that Britain could quit the EU as a result. Cameron then wrote a commentary for several European newspapers condemning Juncker as unacceptable and illegitimate, never to be supported by Britain.

In Brussels on Friday, Rogers invited journalists from the main European (non-British) newspapers for breakfast to ram home the message. The newspapers then published articles reporting that Britain was losing the battle.

"More and more it is clear that Juncker will be nominated," said Swoboda.

Diplomatic cables from Brussels to a north European capital reported on the various meetings and negotiations, concluding that Merkel had decided to push Juncker into the commission job in the autumn and that she wanted a decision next week at the latest.

The cables reported on the results of Van Rompuy's mediation, which included two conversations with Merkel and "one very difficult and long meeting" with Cameron.

Merkel, no big fan of Juncker but facing a hostile reaction at home if she abandons him, was said to be resigned to proposing him for the job.

"Her concerns are that the longer the debate goes on, the more toxic it is becoming," the diplomats reported. "She fears an outbreak of a 'UK v Germany' debate, which could get nasty. The chancellor now favours moving very promptly to appointing Juncker, and – in any event – at the latest at the end of the month."

According to the cables, Merkel told Van Rompuy she had made her position clear to Cameron, while the prime minister contested that in conversation with Van Rompuy. The mediator was "confused" and went back to Merkel.

"The chancellor then left Van Rompuy in no doubt as to her position and said that she had been 'very clear' with PM Cameron on her planned next steps … Van Rompuy sees no alternative to the appointment of Juncker."