Not sure I see how this will make a carrier obsolete, really.
It's not like a carrier is really worried about 5" shellfire, even at extended ranges - the big missiles with 450+ kg warheads are much more of a problem, really.
However, as to evading fire from such a weapon. At 200 km, and 2500 m/s muzzle speeds, we're talking pretty near two minutes (yes, it loses speed the whole way, so it won't be anywhere near as quick as 200/2.5 travel time) between shot and landing. And our radars can detect a shell-sized object now (that's what counterbattery radar is for, after all), so you have a minute or more to change your projected position by 200 meters - you can manage that without even turning, just speed up/down as needed.
This ignoring the detail that you won't even be able to see the carrier at 200 km without aerial surveillance, and the carrier air group will be doing its best to make sure your aerial surveillance quickly becomes sub-surface surveillance....
The obsolescence threat to the carrier does not come in the form of a direct threat to the ship's survivability. That is part of it, but not the whole or even the largest of it, and you are ignoring that largest part. What is the carrier's role?
Projection of Force.
Carrier aircraft allow it to hit targets up 600 to 1000 km away, or more with refueling tankers. Rail guns however can also hit targets at these ranges, or even further, and even harder.
And don't kid yourself about being able to dodge the shot either. Not even 2 weeks ago another slashdot article was going on about a steerable bullet that could be fired from a sniper rifle. There is no reason to believe the shells of a rail gun might not also one day be likewise steerable. If we can build a steering system in a 30 gram bullet we can build one in a 5Kg shell. It doesn't take much steering to hit a moving carrier, which can only move 200 meters at most during the entire flight of your bullet.
And you don't need an explosive in the warhead at all if you have a 2,500 m/s velocity. The kinetic energy from a 5kg slug travelling at that velocity will punch through the hull of a carrier like butter and the impact will be quite explosive without any actual explosive chemicals. After all, F = MV. 2,500 m/s is a LOT of velocity, and you don't need much mass to impart a lot of force on a very small area of the armor to punch through. That's what makes hyper-velocity projectiles so appealing. Their threat is entirely from their velocity - not a dangerous explosive that might go off in storage.
Anyone who thinks the carrier can survive the appearance of the rail gun on the scene of naval warfare is still fighting the last war, not the next war. The carrier is a big relatively easy to hit target for guns. WWI Battleships can't get close enough to them to sink them because of the planes. A railgun equipped battleship however will be able to not only get in range of the carrier, but outrange the carrier. The shell makes the trip in 2 minutes. That's a long lag time, but nowhere near as much as the hour it takes to launch a plane out to and bomb the attacker. Even if the planes are in the air at the start its still 20 minutes before they can be on site. And yeah, you might shoot down or dodge a rail gun projectile, but what about one every minute? Every 15 seconds? A gun may only have a 1 / 15 minutes firing rate, but multiple ships with these can mass their fire on the large target.
Carriers are awesome, but so where battleships, so where Ships of the Line. Their days are numbered, and this gun is writing on the wall for them just as surely as the USS Monitor was the writing on the wall for the whole British fleet that fateful day 150 years ago next month at Hampton Roads.