It is an election contest that could determine the future not just of Scotland, but Britain as a whole. Scotland was a birthplace of Labourism, the nation that produced Labour’s first leaders – Keir Hardie, Arthur Henderson, George Barnes – and political icons such as Jennie Lee.

It looked like it would become its graveyard, too. Social democracy has become a festering political corpse across western Europe – from France to the Netherlands to Germany – and Labour’s near-total wipeout in Scotland two years ago could plausibly have presaged decimation in England and Wales.

Scottish Labour is now gripped by a leadership contest between insurgent leftwinger Richard Leonard and the candidate of the old guard, Anas Sarwar. Whoever triumphs may not only determine Scotland’s future, but whether Jeremy Corbyn’s Labour party wins the majority it needs to form a transformative government across Britain.

The social order in Scotland – just like rest of the UK – is broken, and needs to be replaced, not tinkered with

The demise of Scottish Labour was self-inflicted. All too many of its parliamentary representatives were afflicted with a suicidal sense of entitlement and complacency. It became like an old boys’ club: a moribund, increasingly out-of-touch establishment. The result was a brittle party waiting to be swept away by a political tornado. New Labour spawned political alienation across Britain.

But unlike England, Scotland had a ready-made party that could convincingly position itself as a social-democratic alternative. The Scottish Labour leadership became widely disparaged as Westminster’s branch office. Disillusionment had already set in before the referendum campaign. But then Scottish Labour made the calamitous decision to form an alliance based on fear against independence with the Tories, rather than campaigning alone. In a matter of hours on election night in 2015, Labour went from Scotland’s hegemonic political force to being virtually defunct.

Kezia Dugdale – whose resignation prompted the current leadership battle – was dealt an impossible hand as she attempted to rebuild among the rubble. The truth, though, is that the anger – and sense of betrayal – that former voters feel towards Scottish Labour is so intense that only a decisive break from the past offers a chance for the party’s revival. “I didn’t leave Labour – Labour left me,” is how many of these voters see it.

Many felt that the SNP offered a more progressive choice. Of the Labour voters who defected to the SNP in 2015, three-quarters believed Nicola Sturgeon’s party had the policies to redistribute income from rich to poor; less than half felt the same about Labour.

Recent YouGov polling shows that four in 10 SNP voters think “capitalism is harmful to Britain and there are other, better ways to manage society”. Survation polling, too, shows that 37% of SNP voters would be more likely to support Labour if it offered a mandatory living wage, and 27% if it pledged to renationalise rail.

During the general election, Labour canvassers experienced the same phenomenon as fellow activists south of the border – but with a bitter twist. There was growing positivity towards Corbyn, and the manifesto proved as popular on the doorstep as it had in England and Wales.

Anas Sarwar launches his leadership campaign in Glasgow. Photograph: Jeff J Mitchell/Getty Images

But then came the caveat: we like the message from the national leadership, but we don’t trust or like Scottish Labour. Even though Scottish Labour’s policy offer did not meaningfully diverge from Corbyn’s own vision, there was a credibility problem.

Politics is all too often not about what is said, but about gut feeling and sentiment. Even worse, the Scottish Labour message was relentlessly negative, obsessing over the constitution and stopping another independence referendum. A political broadcast on the eve of the election has been described to me by senior Scottish Labour figures as one of the worst they had ever seen: focusing on damning Nicola Sturgeon as a “broken record” rather than emphasising a positive Labour message.

Days before the election, Sturgeon committed to making Corbyn prime minister in the event of a hung parliament. Privately, Scottish Labour figures believe that this was because the SNP was spooked by internal data showing its voters defecting. But tactics did not change: instead of emphasising Labour’s positive “for the many, not the few” message, the party fell back on ever more bitter denunciations of another independence referendum. “If we’d changed to that positive message, and really pushed it, we’d have won another eight or 10 MPs,” says one senior Scottish Labour figure. Another suggests that the party won its extra six seats in spite of – not because – of the Scottish campaign.

Anas Sarwar is a decent man, but it is inconceivable that he offers any solutions to these entrenched problems. Like Jim Murphy, he is an ex-MP offered up as someone with Westminster experience: but it was Murphy who oversaw Scottish Labour’s loss of 40 of its 41 seats.

Sarwar is backed by the old guard. And then there is his substantial baggage: sending children to private schools, his shares (recently relinquished) in a family company that doesn’t pay a living wage or recognise trade unions, and previously owning shares in a tax-haven firm. These revelations have not just damaged himself: they’ve tainted the Scottish Labour party too.

In all seriousness, what would happen if he became leader, confronting Sturgeon about the state of Scottish education, or about poverty pay, or union rights, or tax justice? The attack lines write themselves.

Richard Leonard, on the other hand, has been associated with the Labour left his entire political life. Like Corbyn before him, he can promote radical policies with the credibility of having always genuinely and passionately believed in them. The social order in Scotland – as in the rest of the UK – is fundamentally broken, and needs to be replaced, not tinkered with.

That’s why Leonard’s promises of industrial democracy are so welcome: for example, pledging employees would be granted the first right to take over any business that goes up for sale. The Leonard campaign is pledging to commit the party to an all-out onslaught against poverty and inequality.

Whoever secures the crown will inherit perhaps the most thankless and difficult post in British politics. A swing of less than 5% to Labour would secure another 21 seats; but a mere swing of 3% away would leave the party with one seat all over again.

Although Leonard has won the support of all affiliates who have so far nominated, and has so far won over twice as many constituency Labour parties, the result is far from conclusive. Can the radical young Scots inspired by the yes campaign be persuaded that Labour is their home? Can the SNP come under unrelenting pressure about whether they would back Labour policies such as hiked taxes on the top 5%, increased corporation tax, a statutory living wage and sweeping public ownership? Can those who feel, understandably, alienated with Scottish Labour be convinced their party is back?

Nothing is assured, whoever wins on 18 November. But without Leonard’s victory, a sustained Scottish Labour recovery seems all too remote.

• Owen Jones is a Guardian columnist