India's supreme court has refused to review the ban on gay sex it imposed last month, rejecting arguments from civil rights campaigners and the Indian government that the move was unconstitutional.

The court's decision in December to reinstate a ban on same-sex relationships overturned four years ago by a lower court provoked anger and shock in India and overseas.

The UN high commissioner on human rights, Navi Pillay, said the decision represented a "significant step backwards for India" and violated international law.

Sonia Gandhi, the president of the ruling Congress party, called on MPs "to address this issue and uphold the constitutional guarantee of life and liberty to all citizens of India" in the wake of the judgment.

But on Tuesday two judges rejected petitions submitted by government lawyers and campaigners calling for a review of the December decision.

Campaigners who have waged a long battle for same-sex relations to be legalised in the world's biggest democracy said on Tuesday they would continue the fight, though their options are now limited.

Shaleen Rakesh, an activist, said the decision was "disappointing and horrible" but not unexpected, adding: "The priority for the community is to hold our heads up and maintain self-belief and identity. It is not easy to live in a country where you are criminalised."

Gay rights activists say gay people in India face significant discrimination and police harassment, even if prosecutions have been rare. Criminalising gay sex also makes many people vulnerable to blackmail, they say, and causes misery for many who already face prejudice, even from close family members.

New legislation, which constitutional experts say is probably necessary to overturn the judgment, looks unlikely. It would be unusually bold for an administration widely seen as weak to take on such a controversial issue so close to a general election to be held by May.

The opposition Bharatiya Janata party, which has roots in deeply conservative Hindu religious and cultural organisations, has supported the reinstatement of the ban and is currently leading the polls.

The fierce debate over the supreme court's decision to reinstate section 377, the 153-year-old law against "unnatural offences" introduced under colonial rule, which has long been interpreted as applying to same-sex relationships, is a further example of how sexuality has become a battleground in India, often revealing cultural splits between generations, between urban and rural dwellers and between those who invoke a "traditional past" contaminated by western influences and those who stress a local history of pluralism and tolerance.

The supreme court judges argued that the Delhi high court had overstepped its powers with the decision four years ago as only India's government could change the law. Section 377 should, therefore, be reinstated, they said.

Few thought the legal challenge – launched by conservatives including Muslim and Christian religious associations, a rightwing politician and a retired government official-turned astrologist - against the 2009 decision to succeed. The supreme court is known for broadly progressive judgments that often order politicians or officials to respect the rights of the poor, disadvantaged or marginalised.

The Indian author Vikram Seth said the December judgment showed "intellectual shabbiness and ethical hollowness" that went against the true culture of an enormously diverse country.

"We are each of us in some way – by caste, gender, sexuality , language or religion – a minority, and the great achievement of the Indian polity over three generations is that somehow or other we have kept together as a nation," Seth, 61, said in an interview with the Guardian last month.

Defenders of the supreme court decision said the objections of the judges to the repeal of section 377 were "constitutional and legal, not moral".

But critics said that the wording of the judgment reveals deep prejudice. The ruling refers to the "so-called rights of LGBT persons", describes same-sex relations as "against the order of nature" and says that "lesbians, gays, bisexuals or transgenders constitute only a miniscule fraction of the country's population".