There is a viaduct in town, rails run on top of it. The viaduct is mapped as a building=yes. Rails only appear, where the viaduct is interrupted - most often there is no building mapped, where streets cross under the railway, not even bridges at times.
The mapping as of now is mixed, some stretches even show windows in osmbuildings (where there are levels coded).
Digging a bit, what renders, and how. Bridges do not show in neither rendering. Building with min level makes for the most correct rendering. But I guess you are right: The Viaduct is not a building in the osm sense of the term
Here a foto of the scene, some of the compartments are open for pass-through streets
Most viaducts should definitely be mapped as man_made=bridge + bridge=viaduct. I can see the argument for treating this particular one as a building, though, seeing how most of the arches appear to have been walled shut and converted into shops or other rooms.
If the viaduct is mapped as a building, I would tag the rails with location=roof and an appropriate layer tag.
The Berlin Stadtbahn, at least parts thereof, are “building=viaduct”. I found nothing in the Wiki on the tag. f4map shows buildings - https://demo.f4map.com/#lat=52.5230019&lon=13.3635897&zoom=19&camera.theta=45.286&camera.phi=-0.286 - A case of/for tag as you like? Or bad style, like “building=bridge”, when the “houses” can be removed without altering the “bridgeness”? Not expecting more of an answer than already given: This is not the tagging ML.