BENGALURU, India — The green benches of the lower house of India’s Parliament were mostly empty on the afternoon of Dec. 18. It was late in the winter session. An earnest but unhurried debate was taking place between Nishikant Dubey, a member of the ruling Bharatiya Janata Party, and Shashi Tharoor, a writer, former diplomat and opposition M.P., who was introducing a bill.

It wasn’t until the vote was called, and a sudden clamor filled the hall, that the significance of the law became apparent: It proposed to decriminalize gay sex. Dozing M.P.s jumped to their feet and barked across the room. One voice was heard jeering, “Tharoor only needs this bill for himself!”

The final tally was 24 votes in favor and 71 votes against, and the bill was sent back to Mr. Tharoor’s drafting table. Yet the debate itself was a hopeful development: Two years after sexual minorities in India were dealt a terrible setback by the Supreme Court, more elected politicians are stepping up for L.G.B.T. rights.

Unlike the courts, the politicians speak for constituents. Their statements come from and travel back to the hundreds of thousands of voters they represent — a national conversation that could do more than any learned court ruling to stop prejudice against L.G.B.T. Indians.