You can use ID to see the direction of the way (indicated via small arrows): OpenStreetMap
The way is mapped in reverse, Overpass is correct. Thus every tool will produce the same result.

Someone mapped it in this way regardless of actual use. You can sometimes see this with double-tracked railways, where both are mapped in the same direction. E.g. here: OpenStreetMap (Part of S2 between Offenbach-Bieber and Heusenstamm)

The mapped direction affects certain properties like *:left, *:right, *:forward, and *:backward. It does not constrain services or which direction traffic can flow, unless oneway is specified.

The “bug” is on your side, you will have to teach your tool to deal with such sections, e.g. by comparing nodes. If you hit any single-track railway with use in both directions (e.g. Way: ‪Südmainische S-Bahn‬ (‪24795769‬) | OpenStreetMap), you’ll otherwise have trouble mapping both.

2 Likes