I’ve seen report on various ways to trigger a bug where you get a glitched rail/road, but all of these are quite old (february-march), and slightly different from this one. Sorry if it’s considered a duplicate.
When you have an unconnected rail’s end (this also work with built-in rails from train stations), you can start building a road anywhere near and if the mouse gets over the rail’s end it will stop moving the (temporary) road and move the rail instead.
This lead to a very buggy situation where the rail will lay wherever (even if it’s a train station rail), the road will lay where you “grabbed” the rail. Neither can be deleted (but it does trigger the infinite resource glitch).
This does not break save; if you save after this happens, the glitched road will disappear on reload. The glitched rail remain where it is though, and if it is part of a train station the only solution I found was to delete the station.