Creosote is composed of a mixture of chemicals, about 300 of which have been identified, but there could be up to 10,000 more present in the mixture. Some components of this chemical cocktail dissolve in water or seep from treated wood. They can contaminate soil and move into groundwater, and persist for many years.
Of perhaps greater concern than contaminating your garden is the health risk that creosote presents to you. The International Agency for Research on Cancer and the Environmental Protection Agency (EPA) have both found creosote to be a probable carcinogen. Low-level, long-term exposure can also cause reddened, blistered, or peeling skin, increased sensitivity to light, and eye damage. Preparing and handling the ties during installation and simply gardening around them could expose you to potential health risks. You could be allowing creosote to enter your body by getting it on your skin, ingesting contaminated food or soil, drinking contaminated water, or breathing contaminated air.
In short, don't use the railroad ties. It's not worth the risk to you or your garden. So what's your best and cheapest alternative? Cinder blocks, or the more attractive concrete retaining wall blocks. These blocks are inexpensive, durable, and widely available. Manufacturers have branched out from the traditional (and institutional) gray color and now offer blocks in a variety of colors and textures, including faux rock.