Hi Maxi,
I could be wrong here, but i do think that they are referring to the railroad tracks, and not the line.
When we say railroad line, we refer to the route that the train is taking and the route that the tracks are laid out on.
But besides that, both sentences are constructed correctly.
Hope this helps.
Aleks