These ruins aren't shifted when spawning, so rails in the right position in the "template" always spawn in the right position in-game. So, fix the rail position in the ruin "template". Alternatively, just convert all the rails to remnants. This may work well for smaller ruins that have entities next rails.
The rail remnants are also on the 2x2 grid, so they cannot be used to work around the grid in small/medium ruins. However, the large ruin was be fixed.
These ruins aren't shifted when spawning, so rails in the right position in the "template" always spawn in the right position in-game. So, fix the rail position in the ruin "template". Alternatively, just convert all the rails to remnants. This may work well for smaller ruins that have entities next rails.