Install the first row of railroad ties end-to-end in the location where you want the retaining wall. Push the ends of the ties as close together as possible. Place a carpenter's level on top of the ties to ensure they are level, since even a small difference results in a crooked wall.
Install a 3/8-inch drill bit into a driil and put safety glasses on. Place the tip of the bit 12 inches from the end of one tie and drill a hole all the way through it. Repeat the process at the other end of the tie to create an identical hole.
Insert a 2-foot-long piece of rebar into each hole and hammer it into the underlying soil, using a sledgehammer, until the top of the rebar is flush with the wood in the tie.
Repeat the process of drilling holes and inserting rebar into the ends of each remaining railroad tie in the base row.
Lay the second row of railroad ties on top of the first row, staggering the joints so that they do not line up with those in the base row.
Drill 3/8-inch-diameter holes through the end of each railbird tie in the second row, just as you did with the first row.
Insert a 12-inch-long landscape spike into each hole and hammer it in flush with the tie, using the sledgehammer.
Repeat the process of installing ties, drilling holes and inserting spikes until the retaining wall reaches the desired height.