Railguns probably have longer effective range. The atmosphere attenuates laser light-- especially in poor weather.
But a railgun can run out of ammo! I don't know if railgun can be made to shoot like a Gatling gun.