Since 2016, Britain and the United States have grappled with a shared fate, facing down the conjoined twins of populism: Brexit and Trump. This week, at long last, came the first signs of a reckoning. After three years in which the winners of 2016 have mocked, pushed or trampled on the constitutional constraints that sustain a liberal democracy, the constitutions – on both sides of the Atlantic – struck back.

The mechanisms are different of course, but the convergence of these two connected stories has been uncanny all the same. The 11 judges of the UK supreme court cancelled Boris Johnson’s unlawful suspension of parliament on the very day the House Speaker, Nancy Pelosi, put aside her previous misgivings and launched an impeachment inquiry against Donald Trump.

Pelosi closed her announcement with a declaration that could serve as a precis of the judgment read out that morning by supreme court president, Lady Hale: “No one is above the law.”

Right now impeachment looks doomed to fail

As if to reinforce the point, in a touch which seemed almost too on-the-nose, that same day also saw Boris Johnson and Trump appear side by side at the UN in New York – Trump joking that a ruling by Britain’s highest court that the prime minister had acted illegally was “just another day in the office”. Smiling and joshing, they looked like partners in crime.

The similarities between these two convulsions, separated by an ocean, range from the trivial to the grave. In the first category, how odd that in both countries the anointed tribune for anti-elite rage and channel for pent-up, nativist fury is a wealthy child of privilege once inseparably associated with the ultra-liberal metropolis. Johnson was the mayor of London who backed an amnesty for undocumented immigrants, Trump the Manhattan socialite who supported abortion rights and gun control. Yet both now pose as champions of the forgotten heartlands against the liberal establishment.

In the second, more serious category, hovering over the turmoil in both Britain and the US has been the threat of violence. During the 2016 EU referendum campaign, MP Jo Cox was murdered; a few weeks later, Trump hinted that gun owners might deal with Hillary Clinton by taking the law into their own hands.

This week, the Commons gasped as Johnson dismissed as “humbug” a pained plea to learn the lesson of Cox’s murder and drop the inflammatory talk of “surrender” and “betrayal”, language that has been adopted in the death threats that have rained down on so many MPs, women especially. In New York, Trump greeted the testimony of an unnamed whistleblower – who had revealed that the president had pressed the leader of Ukraine, needy for financial aid, to “do us a favour” and dig for dirt on a political rival – with a barely veiled threat of his own: “You know what we used to do in the old days when we were smart? Right? The spies and treason, we used to handle it a little differently than we do now.”

Play Video 2:43 Outrage as Boris Johnson dismisses dangers of inflammatory language as 'humbug' - video

What connects these two battles most, however, is that they are framed the same way. Both the Brexiters and Trump insist they are locked in a titanic struggle between “the people” – with “Boris” or Trump as their champions – and the hated elite, comprised of anyone who might thwart their will: judges, journalists or even elected representatives. This leads in turn to the dilemma that has confronted those who would oppose Brexit or Trump. Is it wise to mount a challenge when that very challenge will confirm and strengthen the frame that Trump or the Brexiters have constructed? Put another way, is it wise to fight a populist when a fight is exactly what they want?

In Britain, the dilemma was visible during that ugly Wednesday night in the Commons. Those MPs speaking of their alarm at the increasingly incendiary rhetoric of the Brexit debate had their anxiety etched on their faces. But Johnson was untroubled, insouciant throughout. That might have been because a debate about language provides a handy distraction from the week’s central fact, the supreme court ruling, allowing him to wave aside that verdict as if it were a mere opinion with which he disagreed. (That’s not how the law works. It is not a court’s opinion that Peter Sutcliffe was a murderer; it is a fact.)

But might it not also have been because Johnson welcomes the outrage of a few teary MPs and their defenders on Twitter? After all, that’s apparently been the Johnson strategy since the start: keep on acting appallingly, keep goading the remainers, keep inviting them to denounce and block you all the way to an election that you can fight as “the people v the elite”. A debate about whether it’s appropriate to brand a law preventing a no-deal Brexit as “the surrender act” works well for Johnson, just as the row over the bogus £350m did in 2016, not least because it ensures the idea gets repeated on the airwaves ad nauseam: surrender, surrender, surrender.

In the US, Pelosi was reluctant to move to impeachment because she feared it would give Trump the fight he relished. There they go again, he’d say, Democrats and their friends in the “fake news media” using tricks to remove a president that you, the people, elected fair and square. He could play the victim, howling about witch-hunts and “presidential harassment”, tapping into the deep sense of grievance that animates his base. The circus of televised hearings would provide precisely the polarised chaos in which he thrives.

There are plenty of other good reasons not to go ahead. Right now impeachment looks doomed to fail: it requires the votes of 67 senators to remove a president from office, which means the defection of 20 Republicans. The liberal Republican wing whose desertion spelled the end for Richard Nixon is all but vanished now: the 21 brave Tories who broke from Johnson have few counterparts on Capitol Hill. The notion of US public opinion shifting en masse against Trump is a stretch, too. US media consumption is now so partisan that Trump’s base will only ever hear a story that exonerates him from guilt.

Play Video 1:17 Nancy Pelosi accuses Trump of 'betrayal' as she announces impeachment inquiry – video

The truth of Watergate was near-universally accepted in 1974; it’s hard to imagine anything being universally accepted now. What’s more, impeachment will consume Democratic energies, distracting them from their ongoing primary contest. When Democrats should be talking to US voters about healthcare, jobs and the climate crisis, they’ll be talking instead about Ukraine, transcripts and secret servers.

And yet they have no real choice. The politics of it may be fraught with risk, but it is their duty. The already known facts of the Ukraine episode establish a clear abuse of presidential power: Trump used the might of his office to advance not the country’s interest but his own. Nor can you argue that the remedy for such behaviour is an (upcoming) election, because Trump’s abuse was aimed at subverting that very election.

Tory MPs beware: if you whip up an angry mob, they may end up angry with you Read more

Democrats face the same logic that confronted Johnson’s opponents.

Perhaps, politically, it would have played better not to have a wealthy Londoner such as Gina Miller sue the government. Maybe it did look bad having 11 judges strike down the Brexiters’ champion, thereby confirming every Brexiters’ suspicion about the “remain elite”. But the alternative was to let Johnson’s suspension stand, so that a future prime minister could sweep aside an inconvenient parliament, and its irritating scrutiny, whenever they chose and for however long they liked.

Perhaps impeachment will hand Trump a reality TV showdown he’ll love. But the alternative was to say that when Trump told a group of teenagers in July that “I have the right to do whatever I want as president”, he was right. If Democrats met this abuse with a shrug, it would become the new normal. In Britain and America, the lesson is clear. Fighting populists might be like wrestling with a pig – you both get dirty, but the pig likes it – and yet it has to be done. The alternative is to see our democratic way of life snuffed out while we watch and wait and do nothing.

• Jonathan Freedland is a Guardian columnist