At the last election, Nick Clegg kept his seat but lost his office. After being routed at the polls in 2015, the Liberal Democrats had to vacate the rooms in the parliamentary estate that, as Britain’s perennial third party, they had occupied for almost a century. They were replaced by the triumphant Scottish Nationalists.

The Lib Dems’ new digs were smaller than the old ones. “The portraits didn’t fit on the walls,” recalls one aide. Pictures of every Liberal leader, from William Gladstone to Menzies Campbell, had been displayed in the palatial surroundings they had left – now these had to be transferred to the party’s Cowley Street headquarters.

Their misery was further heightened by the election of Jeremy Corbyn as Labour leader. Tim Farron, his Lib Dem counterpart, had hoped to carve out a niche to the left of Andy Burnham or Yvette Cooper, particularly on civil liberties and immigration. A leftier Labour leader would, they expected, leave them with precious little territory to occupy.

Then came the vote to leave the EU. Among Lib Dem activists, support for the European project is one of three causes that almost all share. (The other two are support for proportional representation and a fondness for Doctor Who.) So here, at last, is an answer to the question of what the party is for: full-throated backing for the European project and a second referendum on the terms of the deal.

Less than half of those who voted Remain want continued resistance to leaving the EU. Yet that still represents 22 per cent of the electorate, and 22 is a rather higher number than eight – the percentage of voters who backed the Lib Dems in May 2015 – so Farron’s decision to throw himself behind the continuity Remain position is a “no-brainer” as far as he and his allies are concerned.

The recent Supreme Court judgment guaranteeing parliament a vote on triggering Article 50 was a further boon. It offers the Lib Dems another chance to repeat their mantra: Theresa May’s Brexit risks Britain’s economic prosperity. Farron has told his party to vote against triggering Article 50.

The challenge is more complex for Labour. Two-thirds of Labour voters backed a Remain vote, but they were overwhelmingly concentrated in England’s great cities and university towns. In most Labour seats, the party’s MPs face a majority of Brexit-backing voters. The ghosts of the 40 Labour MPs who lost their seats in Scotland after splitting with their voters on a referendum loom large. That is why some committed pro-Europeans, such as Emma Reynolds, the MP for Wolverhampton North East, back a hard Brexit that prioritises cutting immigration ahead of single market membership.

Corbyn ought to be the ideal centre-forward for that strategy. The Labour leader is a Eurosceptic of long vintage, having voted to leave the European Community in 1975. Throughout his parliamentary career, he has never voted in favour of a European treaty. In the referendum campaign, his equivocal position resulted from a desire to hold the party together, and because Yanis Varoufakis, the former finance minister in the radical Syriza government in Greece, convinced him that the Brexit vote would trigger the collapse of the EU and a worse deal for its smaller nations. Now, with the vote lost, Corbyn is at his most comfortable sounding a Eurosceptic note.

His difficulty is that his own seat, Islington North, feels rather differently, and the voters he has added to the Labour tent – ethnic minorities, the young and graduates – are among the most sympathetic to the EU. And while Euroscepticism might be a happy tune for Corbyn, the anti-immigration sentiment that powered it to victory is not.

As the Liberal Democrats concede, Labour’s problem is one of success. For the shattered smaller party, pro-Europeanism is its last and only hope for revival. For Labour, any resistance to Brexit adds to the already fraught task of holding its electoral coalition together.

The obvious solution would be some form of deal between the parties of the pro-European left, but relations between Labour and the Lib Dems have never been worse. Even when Ed Miliband made it his mission to cannibalise the Liberal vote, he retained a line of communication to Clegg through his chief of staff, Jonny Oates, and had conversations with Vince Cable. Those backchannels have fallen into disrepair. Only Liz Kendall, who works with Norman Lamb on health issues, is an exception. That hampers any chance of a “progressive alliance” (the heartfelt wish of a smattering of activists in both parties).

The Supreme Court’s decision that Article 50 must be decided in parliament is only a minor setback to Theresa May. There is a healthy majority for starting the Article 50 process in both houses of parliament. However, for Labour, it puts the trigger for Brexit exactly where few of its MPs want it: in their hands. The most likely outcome is another damaging muddle. Many of its leading lights in Remain-heavy seats – including Tulip Siddiq, Daniel Zeichner and Catherine West, who sit on the party’s front bench – will defy the leadership and vote against Article 50.

Some Labour MPs fear that the vote will condemn the party to the fate of many of its European centre-left cousins: disintegration. “We were founded out of trade unions, friendly societies, and so on,” one MP says. “Trade unions are shrinking or withdrawing from Labour. Friendly societies barely exist. Charities aren’t interested. We’re at odds with our own activists.” In the Brexit fallout, the advantage the Liberal Democrats have is that they have nothing left to lose. This time last year, no one in Labour would have predicted that their party would come to see that as an enviable state of affairs.