The general pathing behavior prevents mobs from crossing rails. However, if a solid block is next to the rails, mobs can path over the rails via the adjacent block, dropping down onto the rails from the adjacent block. I've tested with solid blocks such as full blocks, bottom-half slabs, and daylight sensors (though 4 layers of snow doesn't seem to work).
This probably contributes to the difficulties with sending a mob in a minecart up a suspended, sloped track. Given that the mob currently tries to control the minecart, the only blocks acceptable to its pathing algorithm would be back down the slope (from a higher y level onto tracks at a lower y level).
Note that MC-33359 (related) has been marked as WAI.
Linked issues
Comments


Is this still a issue in the latest version of the game(currently 1.13.1)?
If so, please add it to the affected versions, thanks!

Affects 20w46a

Affects 1.17 Pre-release 1

Affects 22w13a
Confirmed for 1.12.2-pre2. Note that the opposite situation seems to work; mobs will still avoid blocks 1 level higher that have rails on top of them, but not lower.