I have a problem with the automatic laying of objects when I lay catenaries for a track I have no problem

however if I pose for 2 ways the result does not take into account the axis of the track ...

What happens? How to put them in the axis as in the previous image.
thank you in advance for the solution you will bring