The law is not a good way to settle questions of objective fact. Indeed, the law is a fucking horrible way to do that.
The law is for arbitrating on questions where a single answer is needed, but none is available; It is a way to take a variety of opinions that are causing strife, bickering, and quarrels, and telling those who hold all bar one of the positions to sit down and shut up.
That's useful for running a society, but as a path to the truth, it is no better than a religion - indeed, it's exactly the same as a religion, other than in the matter of who is selected as the arbitrary voice of authority.
"The law says X" is invariably, inevitably, and by design, and argument from authority fallacy. You can use it for loads of valuable purposes, but determining factual information about reality is not one of those purposes.
The judgement cited in the OP adds nothing whatsoever to the ongoing debate about who is a woman and who is not; It just says that if you are making decisions to which the Equality Act 2010 applies, you are not allowed to do so using any definition other than the one the court just decided you must use.
Judges have also, in the past, ruled that the definition of "US citizen" cannot include negroes; That Pi is exactly equal to 3; and that various defendants were able to employ magic and/or the assistance of the devil to harm their fellow citizens.