Answer: I would not, under any circumstances, use railroad ties anywhere in the landscape. They are treated with creosote which is a skin irritant, but also comes with a long list of other potential problems. So, I'd say thanks, but no thanks to the railroad ties.
There are two sides to the story concerning the safety of CCA pressure treated wood in gardens. One says such products are safe, and cites studies showing little or no leaching of arsenate for years. The other side has its own studies and says heavy metals and toxins do leach at dangerous levels. The newest method for treating wood is Micronized Copper Quaternary (MCQ). It is chemically different than the old CCA treatments. It is made of tiny (micro) particles of copper. These particles are forced into the wood cells or pores during the pressure cycle. Once in, they stay in, also forming a barrier keeping in the quaternary. According to the manufacturer, the leaching of chemicals out of MCQ is practically non-existent and using the treated lumber for a vegetable bed is safe because the chemicals do not leach out into the soil.
When it comes to food production, I tend to gravitate towards the cautious side and recommend gardeners not use pressure-treated wood, especially for food plants. Try cedar, redwood, hemlock, plastic wood or cement blocks as alternatives. If you already have the treated wood and want to use it, line the inside of the planter with plastic to reduce the risk of the chemicals leaching into the soil, then fill with the topsoil of your choice. I'd go a step further and not plant root vegetables such as carrots, potatoes or radishes close to the edges of the beds. Above-ground veggies should be just fine. If you choose to purchase untreated wood for your raised beds you can help preserve the wood by applying linseed oil. The only caution here is that it takes what seems like forever to dry. So apply a very thin coat to the wood after you've built the beds and before you fill them with topsoil.
Best wishes with your backyard project!
Q&A Library Searching Tips