Third gender societies are generally conservative societies who have made accomodation for homosexual or effeminate men, never women. These men work as prostitutes or shamans - and are generally marginalised. India's hijras work as prostitutes (in sex segregated societies, many straight men have their first sexual experiences with such prostitutes being nervous/afraid of actual women) and as soothsayers of a sort (they gatecrash weddings and homes where there are newborns and refuse to leave until they have been paid off for their "blessings"). It is only recently that trans people have been tentatively accepted into mainstream life/occupations. Many trans people are actually driven out of their families and live with hijra communities.
The Hindu religion does not accept or depict a third gender- that is sheer nonsense. Under the reincarnation concept, the soul does not have a sex, hence you can be reborn as practically anything, even an inanimate object. In the mythological stories the male gods (and some demons) temporarily assume female forms to fight each other. This shape shifting is to fulfill the same legal loophole: a demon cannot be vanquished by man or woman, so the god becomes half and half. Literally. Shiva is shown as female on one side and male on the other. Dhoti on the right and sari on the left. Google the pics. There is nothing trans about that!
Now this particular case. The judge is female. The couple were not married but there is a dowry harassment charge. The male partner wanted out of the live in relationship, his family probably tried to help the cut by pressuring for a dowry (it is a tactic to cut off some relationships). Pressuring for a dowry is illegal in India and has resonance in that society. The trans partner went to court with that charge and the defence made some bad arguments while the judge over-reached. Now there is a messy legal precedent in one state - but do remember that India has 28 states. Compare this to a ruling by a state court in Georgia, in the US.
India does not recognise same sex marriage. Neither does Singapore where I am from. There is an interesting twist to this as transpeople can change their legal gender identity and marry someone of the opposite sex legally. But the state can void the marriage if there is a change in sex identification of the partners as has happened in Singapore twice in recent years. You are not allowed to present as a heterosexual couple and then become a same-sex couple with one of the partners transitioning. Western LBGTQ activists lauding this particular court ruling as progressive do not have the full picture.
I find it amusing that many other ignorant remarks about caste, marital rape etc are being made about India. Singapore did not recognise marital rape for many years (until 2020) despite signing up to CEDAW because like India, we recognise muslim family law which explicitly rejects marital rape. It took many years of dialogue with the muslim community (relatively progressive here) until they agreed to recognise marital rape because certain amendments in the civil family system, Women's Charter and the Syariah legal system need to be hand-in-hand in societies like ours with dual track legal systems.