There were cheers inside court four of the Royal Courts of Justice this afternoon, when after a markedly short recess three appeal court judges returned to give their verdict. Sentenced to lengthy jail sentences last month, three-anti-fracking protesters - Simon Blevins, Richard Roberts, Rich Loizou - had what they had known all along confirmed by the lord chief justice, Sir Ian Burnett: the punishments handed down by the judge in their trial had been “manifestly excessive”. Instead of serving 15 or 16 months in HMP Preston, their release from prison is now imminent. But be in no doubt: they should never have been behind bars in the first place.

While a host of legal arguments were made by the appellants’ lawyers and by Liberty, the civil liberties organisation, which intervened in this case, the premise of the submissions was simple: in any functioning democracy the protection of the right to protest is a necessity. It’s a check on government, a means of engagement in politics beyond going to the polls every few years. It’s one of the few expressions of discontent we have, putting our bodies on the line, in a society that is so rigged in favour of those with privilege and power.

It would be cliched to list the causes and campaigners who engaged in civil disobedience who are now looked upon as heroes, so instead I’ll quote lord justice Hoffman, whose previous judgment was relied on today: “People who break the law to affirm their belief in the injustice of a law or government action are sometimes vindicated by history. The suffragettes are an example which comes immediately to mind. It is the mark of a civilised community that it can accommodate protests and demonstrations of this kind.”

The now-overturned sentence was the first prison sentence given to environmental protesters since 1932. Prison should never be a consequence of peaceful direct action. It makes no sense to have our rights to freedom of speech and assembly laid out in law if, upon exercising them, the state can regularly take away our liberty. Regardless of your political convictions or attitude to fracking, we can all breathe a sigh of relief today. What could have marked a chilling day for our democracy could now further enshrine in law our democratic right to dissent.

In this instance, however, it’s not just that the sentences were preposterous. It’s not simply a matter that these three men should never have been in prison, but that the fracking they were so desperate to halt should not be going ahead in the first place. Earlier this month, an Intergovernmental Panel on Climate Change (IPCC) report spelled out quite clearly, in no uncertain terms, the state of emergency our planet is in. Urgent and unprecedented changes are needed if we are to avoid catastrophe, top scientists made plain. James Hansen, the “father of climate science”, even made an explicit intervention in relation to the Tory government’s disastrous pro-fracking policy: “If the UK were to join the US by developing gas fields at this point in time it will lock in the methane problem for decades,” he wrote, adding that fracking will fatally undermine any attempt by the UK’s to fulfil its climate obligations.

The decision to engage in direct action is never taken lightly. Spending nights on top of a lorry, knowing an arrest and criminal trial may well follow, isn’t something anyone would do for a laugh. But if we can’t rely on our government to put our future before fossil fuel interests, then it falls to all of us to lead the way.

The judge in the initial trial didn’t attempt to hide his motivation for handing out the now quashed, excessive sentences, as pointed out by Liberty. A look at Judge Robert Altham’s remarks suggest that the applicants were sentenced to immediate imprisonment because they refused to renounce their views. Far from being a reason to punish these men, their resolve and commitment to halting a climate armageddon should be celebrated.

The three men had been convicted of “causing a public nuisance” after they climbed on to lorries that were bringing drilling equipment to the Preston New Road fracking site in Lancashire last year. Far from being a public nuisance, these men: a soil scientist, a piano tuner and a teacher, have done a great public service. Now it’s time for Theresa May to halt fracking in Britain, just like in Ireland and France, once and for all. Otherwise, be in no doubt: these protests are set to continue.

• Michael Segalov is a contributing editor at Huck magazine, a freelance journalist and author