The [differences between both](https://worldbuilding.stackexchange.com/a/27772/78800) in space are basically the same as on land:
- Coil guns are harder to build. Railguns are easy.
- Coil guns get more kinetic energy into the projectile than railguns for same power and barrel length.
- A salvo from either will [overload any shield on a space ship](https://worldbuilding.stackexchange.com/a/186702/78800) and then penetrate the hull.