You can paint Railway sleepers, but you must use an exterior wood paint or preserver that has been formulated to do this job specifically. The problem with painting sleeper is that you will have to continuously re-paint them to keep them looking good. We would recommend only doing this if essential, it is best to just let them age gracefully.
On the other hand if you are thinking of using additional wood preservative prior to installation to increase protection, this is a different matter and we would fully recommend that everyone does this if time permits, especially taking care to cover all cut ends with the preservative. This will greatly increase the life expectance of the sleeper installation and will result in a far better job.