As has been pointed out, reclaimed railway sleepers will be impregnated with creosote. As has also been pointed out (by Mushroom25), the use of such sleepers in gardens is now prohibited. That's confirmed on the RHS website:
"It is no longer permitted to use railway sleepers impregnated with creosote in gardens, due to the risk associated with frequent (daily) skin contact. If you already have raised beds made from old railway sleepers and have this level of contact, then protective clothing (gloves etc.) should be worn. For new beds, use sleepers treated with other preservatives, or untreated hardwood sleepers"
https://www.rhs.org.uk/advice/profile?pid=428