Specifically regarding the question "let's say this goes to the Supreme Court".
In Minor v. Happersett, which admittedly was back in 1875, the Supreme Court ruled that 14th Amendment "Equal protection" clause did not entitle women to vote. The question of whether it entitled them to go topless wasn't under consideration, but I think we can safely suppose they'd take a dim view.
The opinion of the court included:
Neither the Constitution nor the Fourteenth Amendment made all citizens voters. A provision in a state constitution which confines the right of voting to 'male citizens of the United States' is no violation of the federal Constitution.
...
the Constitution has not added the right of suffrage to the privileges and immunities of citizenship as they existed at the time it was adopted. This makes it proper to inquire whether suffrage was coextensive with the citizenship of the states at the time of its adoption. If it was, then it may with force be argued that suffrage was one of the rights which belonged to citizenship, and in the enjoyment of which every citizen must be protected.
...
But if it was not, the contrary may with propriety be assumed
Fairly obviously, it was not. The case wouldn't have needed to be brought if it was, so one might conclude that the court ruled "sex discrimination is OK in law because sex discrimination already exists in law".
They also observed that the 15th Amendment is redundant if voting is a "privilege or immunity" already covered by the 14th. So, back then voting was not an inherent right of citizenship (later supreme courts apparently have backed off from this position). One can plausibly imagine a court ruling that walking around topless isn't either.
They also explicitly said that they took the 14th Amendment as intended only to concern the rights of former slaves, not to change any other unequal rights that might already exist (I don't know exactly what the status is here. Numerous cases have applied the 14th Amendment to various forms of discrimination other than against ex-slaves. Certainly it has been politically argued that a fresh Amendment stipulating equal rights for women would be redundant, but I don't know the positions of the current Justices on that).
The 19th Amendment (1920) gave women equal rights to the vote, but did not restrict any other privileges and immunities from being abridged on the basis of sex. So it overrides the outcome of Minor v. Happersett, but not their view of the 14th Amendment.
Move on. A more recent court (under Brennan, in the 1970s) further developed the idea for different standards applying to different kinds of discrimination:
laws that discriminate on account of
race, national origin, and alienage
are
subject to strict scrutiny,
laws that discriminate on account of
gender and
“
illegitimacy
”
are
subject to intermediate scrutiny,
and
the vast bulk of
social and
economic legislation, as well as
laws that discriminate
on account of
age and disability,
are
subject to
rational basis review
https://www.theusconstitution.org/wp-content/uploads/2012/06/Crossroads-Chapter-8.pdf
"Rational basis review" means that the law can discriminate as long as it finds some arguable public benefit from doing so. As usual this means an argument and a benefit that a court accepts, not an argument that you or I accept. In particular, the court doesn't necessarily have to agree about the details of the supposed benefit, they merely have to agree that the legislature has standing to decide that it's a benefit.
Of course this is all ancient history, and the current court would take into account current attitudes and common practice, as well as the fact that these days people in general and Supreme Court Justices in particular have different ideas about the nature of inherent differences between men and women, as well as perhaps different ideas about whether existing laws are so important as the definitive source of "rights" on a given subject. So for example Obergefell v. Hodges prevented the prohibition of gay marriage on grounds of equal protection, which I think we can safely conclude that no Supreme Court other than the very recent would have done. The opinion laid out further significant development in the court's understanding of equal rights.
Scalia is history too, but recent history, and he wrote:
Certainly the Constitution does not require discrimination on the basis of sex. The only
issue is whether
it prohibits it. It doesn't. Nobody ever thought that that's what it meant. Nobody ever voted for that. If
the current society wants to outlaw discrimination by sex, hey we have things called legislatures, and
they enact things called laws
The Originalist, California Lawyer (January 2011)
Unsurprisingly, he also dissented from Obergefell v. Hodges. Scalia's originalist position essentially was that if the Congress that passed the 14th Amendment was sexist (or homophobic, or whatever), then the constitition is sexist (or homophobic, or whatever). End of. If you don't like it, pass a law to change it.
In contrast to all this, Bader Ginsburg has taken a different view of the 14th:
What
[the framers of the 14th Amendment]
were getting at, basically, and you will find this popping up
again and again in the legislative record, they were against caste. They did not want the United States to
have any classes
or castes that would identify people by their birth status
Nicole Flatow,
Justice Ginsburg’s Take on Originalism
(Nov. 22, 2011)
She, in common with other liberal Justices, thinks that an "exceedingly persuasive justification" is needed for laws discriminating on the basis of sex, but note that doesn't mean even she categorically rules out that such a justification might be made in some cases.
IIRC there are stacks of 5-4 and 6-3 decisions that Bader Ginsburg joined and Scalia dissented from, where the majority of the court more-or-less believes that changes in public opinion what constitutes "equal" or "reasonable" on a subject can change the effect of the constitution. So, for cases like yours, they might think it doesn't matter whether the framers of the 14th were sexist; what's relevant is whether the current court is sexist. Opponents of those rulings call this "legislating from the bench".
So you cannot have absolute confidence that the court will rule that in every situation it is unconstitutional for the law to treat men and women differently. We can hope they will, and offer arguments why they should, but the institution's past record doesn't justify assuming they necessarily will. A lot depends on Kavanaugh, who replaces Kennedy. Obergefell v. Hodges was 5-4: Kennedy voted for it; Kavanaugh is expected to be considerably more conservative but that doesn't necessarly mean he's as originalist as Scalia was.