To be clear, that's not what this ruling says, that would be a consequence of other laws that can be changed if there's political will. The ruling is just a narrow definition for legal purposes of what the words "Man" and "Woman" mean. If a law is passed allowing for gender identity to be on a passport, then you could have someone who was afab put "Male" on the passport if they're trans.
And if such a law isn't passed, or a law explicitly banning that is passed, then *that law* is the issue, not the definition of sex dictated by biology. Remember, sex and gender are not the same.