India has been bruised lately by bitter, divisive public discourse, disturbing headlines about lynchings of Muslim cattle traders, and controversial arrests of dissenters and left-leaning writers and activists. We badly needed some good news.

This week, a historic Supreme Court judgment reaffirmed India as a liberal democracy. The country’s judiciary finally washed out a 157-year-old colonial stain on the fabric of Indian democracy — a British-era law that made it a crime to be homosexual.

“Majoritarian views and popular views cannot dictate constitutional rights” said Chief Justice Dipak Misra, locating the legalization of same-sex relations within the framework of individual liberty and equality. Justice Indu Malhotra, one of the few women on the bench, called for a national apology to the LGBT community for decades of stigma. And another judge, Dhananjaya Chandrachud, reminded his country that “What makes life meaningful is love,” while elaborating on sexuality as a fluid concept that defied binaries. As the law was given a raucous burial, it was billed by activists as the second independence from the British colonialists.

The significance of the years-long marathon battle by India’s LGBTQ community and its heterosexual allies is not confined to the celebration of gay rights. In an age coarsened by polarization in politics and name-calling on prime-time television shows, this is a thoughtful warning  against majoritarianism and mobocracy. It is a reminder that the country’s core is still fenced in by its constitution. And it is a sad illustration of how the true protectors of that constitution and the Indian republic are no longer India’s elected lawmakers but its courts.

India is legally a parliamentary democracy but, at its heart, it is now essentially a judicial democracy.

We call ourselves the world’s largest democracy; our electoral process has never been interrupted or hijacked by other forces (unlike in Pakistan). In 2014, there were 814 million eligible Indian voters, making it the largest poll exercise in history. But elections alone don’t make a democracy. When it comes to the country’s most sensitive decisions, our votes would appear to have been wasted. Our elected democratic representatives have looked away, or worse, have outsourced all the political risk to the judiciary.

All that was needed was legislation to strike down an archaic law that criminalized millions of LGBTQ Indian citizens. However — with the exception of a handful of individuals, including Finance Minister Arun Jaitley in the ruling Bharatiya Janata Party (BJP), Shashi Tharoor and Milind Deora in the Congress party — no parliamentarian was willing to take a public stand.

The Modi government could have basked in the reflected glory of this moment by at least supporting the petition in the Supreme Court. Instead, it sat precariously on the fence, trying to appease both its hard-line conservative base, as well as the burgeoning  youth vote. The ruling party has been trapped between the spontaneous and vocal homophobia of most of its leaders and the pressure to be socially liberal from its neo-right supporters. In saying neither yes nor no, it has failed a critical leadership test. Many BJP leaders of significance did not comment publicly on the momentous verdict today, and parliamentarian Subramanian Swamy continued to term homosexuality a “genetic disorder.”

The Congress party, by contrast, jumped on the celebration bandwagon, which was both disingenuous and hypocritical. Its liberalism is well after the fact; when the party had 10 years in power between 2004-2014, sections of its government opposed the legalization and others flip-flopped. It can hardly reposition itself now. The party did not even back its own leader, Tharoor, when he made a failed attempt to move a law in Parliament. Both the BJP and the Congress, along with an array of other parties, ceded their constitutional and parliamentary rights to the judiciary in a craven betrayal of their democratic duty.

India’s Parliament similarly flunked when tested for its legislative view on marital rape. Turning the notion of consent on its head, politicians across party lines proclaimed that the institution of marriage would be destroyed if the law were allowed to enter the bedroom. No matter that in the same paradoxical breath they wanted the state to treat gay sex as illicit.

Whether it is homosexuality, adultery, marital rape, larger issues of privacy and surveillance, or even microscopic, administrative matters relating to cleaning up lakes and rivers, the real political action is taking place in India’s overburdened courts, where millions of cases are pending and there is a shortage of thousands of judges. Yet politicians constantly moan and groan about “judicial overreach” and the long arm of the courts. With this verdict and the many others that could follow, they just lost the right to do so.

The right of LGBTQ citizens of India to live with dignity could be a signal for other personal freedoms, as well. In a country where individualism has been surrendered at the altar of majoritarian politics, this landmark decision was about preserving India’s democracy, because “to show exaggerated deference to a majoritarian parliament when the matter is one of fundamental rights is to display judicial pusillanimity,” said Chandrachud. He went on to quote Canadian songwriter Leonard Cohen’s music. “Democracy, it’s coming through a hole in the air…”.

India’s judges surely are the New Cool.