It's not a bug. What if you have a city on an island? It just doesn't get to have its industrial era production boost? That would suck. I assume harbors give the railroad bonus to make them in line with the fact that they earlier gave the road bonus (trade route if no road exists) and to simulate ports and harbors becoming a lot more efficient with the advent of steam/combustion engine machinery and ships in the industrial age.