I first noticed this in Minecraft 1.12, I was not playing minecraft for a long time and started again with 1.16 and this issue still exists. If you place rails and a zombie is on the other side of them then the player, the zombie will not cross them. Skeletons and creepers do so. Zombies only cross rails if they are pointing towards the player or they are going up a block.
Hi, this is a duplicate of MC-33359 which resolves the issue as Works As Intended.