They should be removed. Here's a similar question that was answered by Howard:
Rail Road Ties
QUESTION: Two years ago, we purchased 1.2 acres in a suburban area. My backyard neighbor originally owned more than 10 acres, including my property. He is an old-school farmer who has used many chemicals during the past 45 years. He has treated for termites and fire ants, and he bordered the garden area (about 1/6 acre) with railroad ties. I plan to put eight chickens into a mobile pen in that part of the yard as soon as they hatch and get big enough. Should I remove the railroad ties since the chemicals in them are a source of contamination? And what should I do to restore the soil's health? Should I plant vegetables? Or should I treat the area for a year and plant next year? S.K., Fort Worth
ANSWER: Remove the railroad ties, and then decontaminate the site. First, apply activated charcoal at a rate of 100 pounds per 1,000 square feet. Follow that with zeolite at 80 pounds per 1,000 square feet, and then apply Garrett Juice at about 2 gallons per 1,000 square feet. After that, follow my Basic Organic Program, but double the rate of dry molasses.
Texas Certified Nursery Professional
Texas Master Naturalist