A spacecraft that is in any way designed to travel more than a short distance between two points in the same planetary body's SoI is dominated by the tyranny of Rocket design: It will be mostly fuel. In fact, it'll be possibly about 90-99% Fuel tanks!
Next, we should consult project rho for the question and what they say about kinetic penetrators, aka conventional weapons. Oh, and remember: the weapon is not recoilless, and so slugging another ship with a hypersonic slug also will throw your much bigger ship back, which could in the best case just rip the gun off your ship, or kill everybody on the ship from the impact onto the other side of the ship.
[A]nything hitting something at 3 km/s has kinetic energy equal to its own mass in TNT, or one Rick. Ricks scale with the square of velocity, so something at 6 km/s has 4 Ricks. Given that any scenario with enough human space presence for a war virtually requires transit velocities well above that, kinetics are both lethal and relatively cheap.
Now, what does the projectile do to the other ship? If they are smart, it is vented, so the pilot might survive a shot through the cockpit unless he is pinned by the projectile. On the bad side, any shot through the fuel tanks - which make the larger part of of the ship - will cripple the ship, leaving it to die without the need for anything else. Yes, any shot has a large chance to hit the most vital part of the ship: the fuel supply. Vented fuel doesn't blow up the ship. No. It just vents out and ruptures the tank. Even with several tanks and only hitting one redundant tank... suddenly the ship is left in the same position as Apollo 13: the one tank blowing apart will do damage to neighboring components, most likely other tanks, so they leak. The ship now is on borrowed time and bleeds out.
However, unless you have a really good idea where to shoot, you have a hard time hitting anything with what accounts to a pointmass compared to the ship target: engagement and travel times are just large enough that a tiny random change in the direction of the target ship will surely evade any shot unless one unloads a barrage of hundreds of thousands of shrapnel pieces to block all corridors and trajectories that are possible. Project Rho estimates it takes 129600 simultaneous shots to hit a target that can accelerate up to 1 m/s and has a diameter of 10 meters (11 yards).
The same target only would need some 1700-2000 lightly guided penetrators to be a guaranteed hit, if those could only home for the last 10 seconds while steering at 1 m/s. If you can guide the penetrator for the whole flight a single would suffice. It just needs to track and steer well enough for the entire flight - it's pretty much a missile then, just that it might not have a forward propulsion, and instead just needs to steer to keep the target in its target cone.
Not target cone, Guaranteed Kill Cone:
A hypervelocity impact can be divided into four phases. First, there is a transient shock, and the front of the projectile is brought to rest relative to the target. This produces very high temperatures and pressures, and a bright flash. During the next phase, the projectile continues to penetrate into the target, but is eroded as it does so. The length of this phase depends on the length of the projectile and the speed of sound in it. If the object penetrates the target, the shocked portion will disintegrate, spewing fragments. These fragments will come from both projectile and target, and will separate into two cones, one that is basically normal to the surface just penetrated while the other continues at about the same angle the projectile hit at. At the same time, if a portion of the projectile is unshocked, it will continue onward, penetrating deeper into the ship. This could allow a long-rod to go through multiple compartments, getting shorter each time, and leaving clouds of fragments in its wake. The fragments would spread, distributing the damage over a greater area. If an outer whipple shield was used to shock the projectile, the spreading fragment cloud might lack the energy required to penetrate the main armor behind it. Even if it fails to penetrate, however, spalling (shockwaves knocking fragments off the back of the armor) could result, with unpleasant consequences for anyone on the other side.
Or in a picture:
The impact of the tip of the projectile will rip everything in front of it into making shrapnel. Then the rest will break through the new hole and fill everything in its path with shrapnel by repeatedly losing its tip to create more holes and shrapnel. It'll destroy any and every piece of equipment that is there - and to armor against them would make you just carry more and more fuel just to get moving. And you are already required to be pretty much mostly a fuel tank anyway. The Whipple shield (a thin plate held at a distance from the ship) mentioned in the quote above? Useless, unless it is hit flat on orthogonally... and they only help against really small impactors. Not against several kilos of the penetrator.
So at the bottom line: projectiles are a cool idea, but uneconomic if unguided. Railgun shots will go straight through and either bleed out the fuel reserves, rip chunks from a hit ship, fill the target ship with shrapnel that creates secondary and tertiary destruction outside of the direct path, and in all results turn the ship into a (soon to be) wreck. Unguided you won't hit unless you are really close, which is unlikely because of the engagement range in free space: if you can see it, you can shoot at it. You usually fight at distances where light takes time measurable mechanically to get from the target to you. And it's hard to hit a moving target at those speeds. So it better be self-correcting in movement. Aka: it's a missile without a warhead. Oh, and remember: firing your railgun will kick your own ship quite a lot.