Array modifier - fit curve length problem

I’m trying to make a road bridge that is controlable with a curve. The bridge consists of a few parts like pillars or railings and I would like all of them to match the curve length, however some of them do and anothers don’t, just like on the screenshots.

This the main part, which works fine.

However this is one of the details which does not

And this is another detail which also does not work but has completly other length from the other not working part.
What is more, if I set lengths manually, it follows curve’s shape correctly.
What may be the reason and how can I fix this?

Why not simply join the meshes?

I would guess that it doesn’t work because the length of the rail is different from the length of the other meshes . Try to make all the original meshes the same length (in edit mode) and then the array modifier will replicate them the exact same number of times. Once it work, you may want to adjust that length if you need to perfectly fill the curve length.

Try this on 2.79b to see if the behavior is same. The 2.80 version was acting funny when I tried it the last time, and same thing worked fine in 2.79b There might be either some bug or behavior change regarding the curve/array modifers.