I suppose. Its just that Railguns are at a severe disadvantage against RPGs when there is a wall seperating them. It makes it pointless to have railguns gps (only way it'd work if someone breached the wall or they were near an openning) on the outer walls as they can shoot over the wall.
I didn't suggest that the railgun gets infinite range (which btw, when it hits an object it loses a lot of its velocity), I simply suggested that it go through a wall.
Also, name a laser with infinite range that isn't a few nanometers across. A weaponized laser I highly doubt would have infinite range... the power supply to do so would be horrendous. That is why it has a limited range.