I have old railroad ties around as retainers for dirt. I have strawberries growing above one set that is 3 ties high, and onions growing below a 1-high step. I don't really worry about it.
When they were originally creosoted, sure they contained lots of nasty chemicals that could kill lots of plants and wind up where you didn't want them. But then they spent decades sitting under railroad tracks, and the more leachable compounds were leached out with every rain. Then they were recycled when the railroad was taken up, and stacked up some place where even more compounds leached out with each rain. Plus fungal spores began to grow in them as they lost their 'preservative' compounds. About half of my ties are so rotted that they don't really work as a retaining wall. Maybe I should completely give up on them being useful for landscaping and throw them in a hugelbed to complete their breakdown.
If there are soft spots in them, places where rot is obviously occurring, then the fungi have gotten the upper hand and the preservatives are no longer there to contaminate your soil. If weed seeds can sprout and germinate in the cracks in them, then they have lost a lot of their toxins. Since all of mine are in that state, I don't worry about them contaminating any of my soils.
Of
course, this is different from the green treated lumber that is often used for decking and other outdoor applications. It isn't creosoted, but treated with a copper-arsenic compound. That type of treated lumber IS a problem and needs to go to a landfill where it will be removed from the biosphere. The copper and arsenic will hang around and create problems if you want to grow vegetables in that soil. Creosoted railroad ties are a whole different matter, and will decompose naturally, although it will take decades, not months or years.