The far right will have to decide if they hate Muslims or transgenders more.
The far-right nowadays is divided between religious trads and wignat edgelords. The trads will absolutely side with the Muslim. The wignats... I can't tell you, they'll probably just rant about how both these people deserve to be shot.
I think the Muslim inmate probably loses the intra-left public opinion war (trans x are x vs. cultural relativism) and wins the intra-right public opinion war (what you're describing), all else being equal, but I guess we'll see.
It'd be different for the talking heads on cable news though. They're far-partisan, not far-ideological. I think this will largely freeze them up because they can't just mindlessly demagogue.
I do think general public opinion would side with the Muslim on this one. In Scotland a few years ago where there was a bill which included a provision that for some sort of medical thing that I assume involved genitals though I forget the details, a patient had the right to request it be done by a doctor of the same gender. Someone objected to this and put up an amendment changing gender to sex. It passed overwhelmingly including most of the SNP in support. A few SNP or Greens and Lib Dems were the only ones to oppose IIRC.
It seems that public opinion is much more supportive of the trans movement on stuff that primarily involves gender presentation than on stuff in which sex itself is directly relevant.