Sex is not a continuum; unlike gender it is either male or female (with the very rarest of biological instances), even though there are sometimes variations within the framework of sex. Semenya and DSD-XY athletes - who as the term indicates, have "differences of sexual development" - are reductively male, just as there will be DSD/female athletes; but they will fall on one side or the other of the sexual divide.
The legal question you pose has two parts to it: what if the "law" - which in this instance is currently the Court of Human Rights - decides against the WA rules, and, secondly, how far does the jurisdiction of that Court (or any other) extend? The response to the first part is that we haven't arrived at a point where a Court says the rules as such must change - and there is nothing inevitable that that will happen - and for a Court's decision to have any binding effect it has to have authority/jurisdiction over WA and sports governance bodies - which in part answers the second question. As each nation is sovereign, any decision a Court arrives at in one country will not bind the laws of another. So a decision, were it to apply, wouldn't be necessarily be universal.
The question is ultimately a political one; if sports hold adamantly to one view while a court holds to another the issue would be possibly decided through legislation, which is of course only binding in the jurisdictions or countries to which it applies. In essence, if public support goes with the sports bodies that is the way the law will go - and the converse applies.
As I have said, the crux of the issue is whether sports can continue to apply their own rules, based on biological criteria, or they become legislatively bound by the view that self-defined gender is what decides who can compete as a woman. Despite the passionate argument in favour of the latter from the left I doubt the majority will accept that.