Energy weapon that travels at the speed of light?
requires line of sight and fails in heavy rain snow and thick fog, sandstorms.
A railgun projectile that travels slow enough that the target can evade before the projectile reaches it? Meh.
only consider slow when your comparing it to speed of light, when conventional weapon (missiles rockets bullets) it fucking super fast,
and things you are likely to target with a rail gun like many like fortification, buildings bases, cities don't move at all or don't move fast enough like aircraft carriers battle ships.
they are both good weapons for different things. You use your laser to stop missiles and planes and use your rail-gun to turn the air field and missile silo into a smoking crater.