Railgun is in NO way a harem anime- there is NO harem. Index does, so dont watch that.
But since in railgun touma is an minor comedy side character who shows up for a few minutes in a few episodes- and the only person to have a crush on him is Misaka- the others never even meet him once. In railgun S2 he has a bigger part in the earlier episodes but he is still a side character, and except for a few seconds once, nobody but misaka meets him, I STILL dont see how that is a harem in ANY way??
Since when is the main character having a crush on a minor side character- and none of the other girls have even met him really, qualify as a HAREM??
IF you claim railgun has a harem you have never seen it or are lying, or confusing it with index. If you only have watched railgun, what roles these characters may or may not have in that is irrelevant.
The yuri in it IS treated only as comedy though. I think it has good characters still, besides the annoying minor side character touma.