I think the legal arguments on this have yet to be fully fleshed out and tested. But if the consensus is that this an equal protection issue, then federal law would supersede state law.

I think lawmakers know this, but "leaving it to the states" has always been a handy way of sidestepping the 14th Amendment (Jim Crow laws, same-sex marriage, access to legal counsel, interracial marriage, etc.).