I don't think this is usually true in practice. In order for a single 10cm laser in a turret to be as effective on a per-weapon basis as a 10cm railgun on a ship hull, the racial tracking speed needs to be 4x the ship speed. Add in the tonnage overhead, which is something like +40% so in this case +60 tons, and you need to be more like >5x the ship speed with the turret to break even on a tonnage basis. Unless you are using extremely slow ships (i.e. commercial engines, basically -- for most players I think very much an edge case) this isn't really feasible unless you hugely rush BFC techs, and most players I think rush the propulsion techs, not the BFC techs. Which brings up another factor, the 4x tracking speed for a laser turret BFC is an additional extra cost against the railgun PD.
When I meant more effective I did not just mean in a PD capacity directly, but as a complete weapons system.
I would normally think that your BFC is about three times faster than you "normal" ships, roughly.... but that obviously depends allot on your doctrine as well as technology. In the new version of the game if you run with the new limitation to technology you might actually have better sensor technology than engine technology, at least it is a bit more likely than before.
If you start to compensate ship speed for accuracy your PD railguns will come at a very high price... both in tons and cost of the ship. At least from a PD perspective. But if the ships is used for other purposes too it can still be worth it, then the biproduct are just an increased PD efficiency too.
But anyhow I do agree that railguns are generally better PD weapons, at least early on. Lasers do work good as hybrid weapons when and if you have good laser and sensor technologies. You also can use reduced size lasers too... if you are more concerned about large volleys rather than smaller volleys fired in short bursts.
But if I go Laser focused PD I probably go with 12cm or even 15cm PD lasers as they are better hybrid weapon systems than the 10cm ones and simply add some 10cm railguns as close in PD weapons. The railguns require so little research that you can have both.
But the ECM effect on railguns can be very extreme in some cases, that is an important achilleas heel of the railgun. Fortunately the AI don't seem to use ECM on their missiles... but factions in my game does so I need to consider it.
In the new version of the game you also can lack Missile/Kinetic scientists or have bad ones, that leave you with using them either for missiles, railguns or gauss. This can make 10cm railguns good as a "poor" mans close in weapon system rather than use Gauss weapons. if you have good energy scientists you might go down the laser path and might as well use laser turrets for PD and ship to ship combat.
You need 2000RP to get basic Railguns but you only need about 6500RP to get decently good Gauss which are way less susceptible to ECM than railguns. The Gauss just escalate in efficiency over railguns from there. So, heading in that direction and use lasers turrets until then can be a decent option too... that is skip the railgun technology and save the 2000RP. If you play with slow technology progression like I do, this actually matter... trust me it does.
My general advice is... if you don't intend to use gauss weapons I would always find the 2000RP to at least get 10cm railguns. But they might not always be needed as you might be more interested in the hybrid effect of the laser.