That I'm not so sure about. The fiber is by the railroad track because railroads have god-like power, at least in the US. They can do pretty much what they want in their right of way, so it is easy to lay fiber when you don't need to get approvals.
If a railroad crossing causes traffic problems, it is up to the town to build an overpass. The railroad right of way is supreme.