Boris Johnson should change his name and move to Hungary. “My policy on cake,” Johnson famously says, “is pro having it and pro eating it.” With this approach to Brexit, the British government will end up neither having its cake nor eating it. Viktor Orbán’s nationalist populist Hungarian government, by contrast, is triumphantly practising the Johnson doctrine. It receives more European Union cake per capita than any other member state while mustering nationalist support by biting the Brussels hand that feeds it. Boris Johnzsönhelyi would be a happy trooper on the Danube.

Increasingly, attention has turned to linking the money countries get from Brussels to respect for the rule of law

Poland is also having its cake and eating it. According to European commission figures, more than half of all public investment in Hungary and Poland in 2015-17 was funded by the EU. I recently visited one of Poland’s poorest regions; wherever I went there was a road, a bridge, a marketplace or a train connection being modernised with EU funds. Yet the country’s de facto leader, Jarosław Kaczyński, has eviscerated the independence of the courts, turned public service radio and television into propaganda organs for his Law and Justice party, and continues to pursue Orbánisation à la polonaise. He hasn’t got as far as Orbán, but the consequences of east-central Europe’s largest country sliding into Hungarian-style soft authoritarianism would be larger for the whole EU.

Here is a fundamental challenge to anyone who thinks the EU should stand for values of liberal democracy, pluralism, the rule of law and free speech. If it doesn’t defend these values at home, it cannot be credible advocating them abroad.

A protest in Budapest last month against Viktor Orbán’s government. Photograph: Bernadett Szabo/Reuters

Reflecting on the Orbánisation of Hungary, the political scientist Jan-Werner Müller asks: “Can a dictatorship be a member of the EU?” Of course, Hungary is not yet a dictatorship, but the EU has completely failed to draw a red line and say “thus far and no further”. I am confident Britain will remain a liberal democracy even if it leaves the EU; Hungary and Poland, by contrast, will remain members of the EU but are ceasing to be liberal democracies. In the very countries where, three decades ago, the causes of freedom and Europe advanced so magnificently arm in arm, these causes are now being prised apart by skilful, anti-liberal populists exploiting a longstanding disconnect between the Europe of values and the Europe of money.

This problem runs through the history of European integration, with the values being defended by the Council of Europe, its European court of human rights in Strasbourg, and to some extent the Organisation for Security and Cooperation in Europe (OSCE) – whose election monitors criticised Hungary’s running of its recent election. The EU started life as an economic community. For decades now, attempts have been made to reverse-engineer the values back into the economic community. This has worked well in influencing the behaviour of countries aspiring to EU membership, but once a country like Hungary is inside the union, it rapidly finds it can get away with almost anything.

A float features Viktor Orbán and Jaroslaw Kaczyński, the leader of Poland’s Law and Order party, at the Rose Monday parade in Germany. Photograph: Lukas Schulze/Getty Images

What can the EU do? It has applied to Poland an elaborate procedure for addressing “systemic” threats to the rule of law, including proceedings for infringement of the treaties. This has been important symbolically, but largely ineffective. Poland’s own ombudsman, Adam Bodnar, finds that the rule of law has already been seriously undermined, and the constitutional court emasculated. Brussels has been playing chess against a kickboxer. The kickboxer wins.

For the first time ever, the EU has activated article 7 of its basic treaty, identifying a serious and persistent breach of fundamental EU values in Poland. Article 7 envisages sanctions, up to and including suspension of voting rights in the union’s internal decision-making, so long as all other member states agree. But they won’t, because Hungary will have Poland’s back and Poland Hungary’s.

Increasingly, attention has turned to linking the money countries get from Brussels to respect for the rule of law. In last week’s proposal for the EU’s 2021-27 budget, the European commission has elaborated a remarkable procedure: if there are “generalised deficiencies” in a member state’s legal system, the EU can cut the flow of funds. Since such an action only requires a majority in the European council, Poland and Hungary couldn’t veto it.

In addition, the European anti-fraud office and the European public prosecutor are to crack down on corruption in the distribution of EU funds. This matters because a crucial part of east-central European Johnsonism is using EU funds for political patronage, rewarding supportive media owners and other cronies, as well as more straightforward pocket-lining. The outsize, brand new football stadium and barely used single-gauge railway near Orbán’s childhood village of Felscút has become a global symbol of this.

The European commission proposals are welcome, but will not begin to bite for several years. We need something with more immediate impact. That something is the expulsion of Orbán’s Fidesz party from the European People’s Party (EPP) before next year’s European elections. The EPP is the EU’s main grouping of centre-right parties. Leading figures from its member parties include German chancellor Angela Merkel, Spanish prime minister Mariano Rajoy, European commission president Jean-Claude Juncker, and European council president Donald Tusk. It emphatically holds high the values of liberal pluralist democracy.

Friends in the centre-right parties say: “It’s still better to have Orbán inside because we can influence him there.'

What is more, party groupings such as this, with their spitzenkandidaten in European elections, are supposed to be at the heart of the EU’s internal democratisation. Yet it keeps in its ranks a party that is not only dismantling liberal, pluralist democracy at home, but fought its last election on an anti-Brussels, xenophobic platform, including dog-whistle antisemitism in posters plastered across the country targeting George Soros and a fictional “Soros plan” for flooding Hungary with Muslim migrants. The EPP does not merely tolerate Fidesz; it actively supports it. As the Fidesz MEP József Szájer noted in an appreciative email to fellow MEPs (leaked to Politico), EPP parliamentary leader Manfred Weber “came … to Budapest to support our campaign, to stand firm beside us”, and party president Joseph Daul “considerably helped us to score this success”.

When I make this argument to friends in these centre-right parties, they say: “Oh, but it’s still better to have Orbán inside because we can influence him there.” And so they go on nursing the classic illusions of appeasement, playing chess against a kickboxer.

We don’t have time for this any more. The matter is urgent. If Poland follows the Hungarian path, much of east-central Europe will have succumbed to creeping authoritarianism – and all of this will have happened inside the European Union.

• Timothy Garton Ash is a Guardian columnist