what is the easiest way to paint train railway?
If you have modeled the railway with athe combo of array+curve modifiers



I would suggest to assign materials before applying modifiers:



If you have already applied modifiers and you have a similar topology, you can select linked by pressing Ctrl+L while at least one face of each metal binaries is selected.



than assing those faces your metal material.

If you have non-linear topology, you'll have to try to mask selection using a combination of selection tools depending on your own topology: