sorry I meant that when deciding where to place cities I only count the 4+ tiles (and usually you'll find these are the ones the city is working)A lot of tiles that's just not possible.
But [a harbour] will not net you the 50% railroad production bonus.
Yeah it does, it's not documented anywhere but you'll see it in the city screen and it is effective. But, it requires a harbour either in the capital or in another city that does have a railroad connection to the capital.
I've not tested but I assume if your harbour city is connected by rail to another, that one will also get the production bonus.
In short I think it follows the same rules as trade routes, just not counting roads.