One word that people seem to have forgotten and that balance out harbours a little: blockades.
Yes, that's a BIG downside. When a war starts and the enemy blockades a half-dozen cities with Caravels left over from the olden days, it's nice to not have your economy crippled in the turns before your navy can clear them out. And here are a few more ways it's balanced:
1> That movement bonus for railroads becomes VERY useful once you get larger empires. What's the point of building a brand-new tank if it takes you 10 turns to get it to the front lines? Roads are an absolute necessity, as a result, if only to avoid the 2MP cost for difficult terrains when shuffling units around. This also allows you to use fewer workers (since you'd just shift them back and forth as new tiles are added instead of needing to permanently assign a few in each area), which saves a ton on maintenance. Railroads just make this even better.
(Side note: In my Alpha Centauri-based future mod, I'm adding Magtubes at a higher tech, that basically cost 3gpt but have infinite land movement; depending on the map, we all know how huge that can be based on our experiences with earlier Civ games. I'm now wondering whether 3gpt per tile is even enough, or whether I need to bump it to 4...)
2> A Harbor costs 3gpt. While railroads are 2gpt, again, you'd want to connect coastal cities by road ANYWAY (at a cost of 1gpt per hex), which means forgoing the railroad to build a harbor only saves you money if it would have taken more than 3 railroad tiles. So really, if the coastal city is three hexes away from another city, it's the same cost either way and there's no point building the harbor, and given the movement advantage, the break-even is more like 4 or 5 hexes unless you really needed the Harbor's sea production bonus.
3> Unless you're on an archipelago map, you WILL have some landlocked cities. So you'll need some rail lines to those cities anyway, right? It often becomes fairly cheap to extend spurs off those lines to nearby coastal cities, since it might only add an extra one or two hexes to the line.
Harbors are still, of course, critical when moving onto a new continent. But I rarely build more than one harbor per continent, even if the cities are all coastal, because the other effects of roads are just too important.