When a mob is chasing the player, or just randomly walking around, the mob will avoid walking across the rails.
How to reproduce:
Make sure you are in Survival mode
Place some rails
Go on one side of the rails
Place a Zombie on the opposite side
Watch as the Zombie will walk around the rails when chasing you.
I have also recorded a video of how it looks and how to reproduce it, however, the file size of the video is too big (around 83MB), so I had to upload it on YouTube: https://youtu.be/TeiyNBH7B4I
Linked issues
Comments

Duplicate of MC-33359. This is intended.