So the court did just that, and defined (for the purposes of legislation) what "Man" and "Woman" refers to, i.e. sex not gender. A person with XY chromosomes, but some sort of developmental disorder that makes them appear feminine isn't some kind of massive puzzle from a biological point of view either, you'd just say "Male with AIS" for example. From a legal (in the UK now) point of view you'd say the same, and from a social point of view you'd say whatever that person identifies as.
People love pointing out that biology is complex, but for some reason bristle at the prospect of language that accurately expresses that complexity. And to be clear, if someone who is XY identifies as a woman... *Call them a woman!* It's rude and cruel to do otherwise, but from a legal standpoint it's unhelpful to play word games.