Then it's not a bug, only a minor graphical glitch resulting from a feature in CivUP. They added the railroad bonus to the capitol itself (in Vanilla, the capitol never receives it). As a result, the capitol shows it's connected to itself.
Probably, you discovered railroad but havn't built any yet, and that's why other cities still shows the road connection.