Huh, why not use lasers? If they are up close and personal I would use the weapon that does the most damage at close range. Or are you just teching heavy into railguns?
Several reasons, actually:
Railguns do more damage, per ton and power cost, than lasers. A 10cm railgun does 4x1 damage, a 10cm laser does 3 damage.
Railguns fire multiple times in a round; a 10cm railgun fires 4 shots, and can therefor destroy 4 missiles when used for point defense, whereas a laser only fires once. The main weakness of beam fighters is closing to beam range in the face of missile fire, so being able to shoot down 4 times as many missiles is a huge advantage.
Compare this to the advantages of lasers:
Lasers have higher range, which is less important for fighters; generally a beam fighter wants to be as close as possible to the enemy. There are exceptions; a laser fighter can do better at staying outside of gauss point defense range, for instance, but generally I feel missiles are a greater threat to beam fighters than point defense weapons.
Lasers pierce armor better. Again, not as big an advantage for fighters; if the opponent has 6 layers of armor, 3 damage clumps aren't going to be much better at piercing armor than 3 1 damage clumps. Note that this is a different story when it comes to large weapons on capital ships; a 24 damage laser is much more likely to penetrate armor than 4x 8 damage railgun hits.
If I'm designing a big hulking beam battlecruiser, I definitely prefer lasers; the range and armor piercing advantages are pretty big (and that doesn't even factor in the ability to make spinal lasers, but currently not spinal railguns). But most of their advantages are minimized when used in a small size on a fighter, while the advantages of a railgun are maximized.