For those who garden in small areas, raising the beds provides plenty of space for good soil. However, shoring up the edges with treated lumber or railroad ties could poison your plants. The toxins in treated lumber (chromium and arsenic to name two) and the creosote in railroad ties will leach into the soil.
If this news comes too late, remove the offending border immediately. Talk with the experts at your local garden center for the best ways to treat existing soil in your area.