You actually have two separate problems to consider here.
A hypervelocity railgun being fired from a tank or fire support UAV is coming in at a fairly flat angle and fired from a relatively short range (assuming this is Desert Storm VIII you might be able to get a sight line to the horizon, but even then you are only speaking about @ 5km).
OTOH, the naval railguns as described for fire support to ground forces are being fired from several hundred kilometres away (current USN descriptions of the subject speak of a range of 200km). In this case, the round is reentering the Earth's atmosphere from a high trajectory and coming at the target from a very steep angle. A "smart round" might actually deploy small fins to adjust the trajectory and strike at a plunging, almost vertical angle.
So your protective system(s) would be dealing with both rounds coming in at a flat angle and plunging fire from rounds reentering from space.
Currently, the direct fire threat is handled through heavy plates of dense armour. Some versions of the M1 tank use depleted uranium encased in steel, which for all practical purposes is about as dense as physically possible. This is considered the best way to deal with current APDS-FS rounds (Armour Piercing Discarding Sabot-Fin Stabilized). The current M829 round used in American tanks (NATO nations would use similar rounds) has a muzzle velocity of 1670 m/s, an effective range of over 3km and is considered able to penetrate 540 mm of RHA steel armour at 2000m, so you can see there is a considerable bar to clear.
Various counters have included thicker and denser armour, using layers of armour of different density to force the round to "tumble" and prematurely break up, using plates of glass or ceramic to shatter and absorb some of the energy of the incoming round, Explosive Reactive Armour (ERA) which shoots a plate of steel into the path of the oncoming round and even longer range active defence systems like DROZD or TROPHY, which use a rocket or mortar like projectile to intercept the incoming round. The Swedish "S Tank" had a "picket fence" arrangement on the glacis plate in an attempt to force incoming AP rounds to tumble, as an alternative.
TROPHY LV fitted to a MRAP vehicle
S Tank with the "Picket fence" installed
The problem with all these methods is the target is much heavier and needs to be fitted with more complex gear (sensors, firing mechanisms or ERA bricks and so on), which increases expense and reduces performance. There is also a danger radius around the tank as well, since the protective system must be automated and can fire without warning nearby troops.
This also has diminishing returns against a railgun round, since it will be moving considerably faster, meaning there is far less time to sense the round and react (in the case of an active system), and no practical amount of armour protection will stop the round. Given the size and energy of the railgun round, any laser system capable of destroying an incoming railgun (or even an APDS-FS) round in flight would be a main weapon in its own right.
Incoming rounds fired from ships at sea can be treated in a similar manner to incoming ballistic missiles. This means you are now looking at a dedicated theatre defence system, with long range radars and tracking systems, and possibly three levels of interceptor weapons to engage at high, medium and low altitudes. The problem here is the incoming round could be as cheap as a simple bar of metal, but even a sophisticated homing round would still be far cheaper than several sets of interceptors. The interceptors still need to be able to meet a target moving at a minimum of about Mach 6, so there is not going to be much time to react, or recover from a miss.
For a short range tactical defence system, it might be possible to have a set of UAV's circling overhead. They provide sensor coverage and can serve and the launch platform for high speed rockets to attempt to disrupt the railgun round in flight. The vehicle or bunker still needs heavy armour in case the railgun round breaks up in flight and pieces strike the target.
Think of each pod as being good against one incoming round
Protection against naval gunfire is most likely going to involve spoofing target detection systems so the ships cannot get an accurate fix on the target in the first place, followed by some sort of area defense system like "Iron Dome".