Well, of course there's the tedious approach...a brush, white paint, a lot of patience, a glass of merlot, soft, soothing music, back massages, etc.
Then there's the approach many of us who have dabbled in the smaller scales...HO and N...have used to paint rails and ties.
If you wish to paint the ties only, try spray painting from above and along the direction of the rails. In other words, pretend you are trying to paint the tops, only, of the rails...in addition to the ties. You will, of course, but there should be minimal overspray on the sides of the rails using this spray angle. Immediately after spraying, take a rag/paper towel dampened with the appropriate paint thinner and wipe the fresh paint from the tops of the rails.
One advantage you may have in using this technique on sectional O3R track is to hang or stand the pieces vertically on a (covered) wall, board, ...whatever... which will give you a more easy spraying position.
I've used this technique successfully several times on the small scales....never tried it, yet, on O. I've always used an airbrush in doing this....more control and focus of the spray pattern...but I suppose it might be tried using a plain ol' rattlecan.
As usual, if you have any scrap pieces, you may want to experiment a bit with this first.
I know you're not painting the rails, but to complete the concept used on HO/N track the rail sides would be sprayed at a very shallow angle to both sides of the track. This would minimize adherence to the tops of the ties. Again, the tops of the rails would need to be wiped down immediately after spraying.
One final thought...since it would be more easy to do with O3R track than HO/N, you might consider first taping the tops of the rails with some narrow...say, 3/16-1/4" masking tape (cut your own or you can usually find it precut at well-stocked LHS's). This would make rail clean-up much easier, and might further avoid overspray onto the rail sides.
FWIW, always...
KD