Mark the location of the wall on the ground with spray paint.
Excavate a trench along the spray-painted line that is 12 inches deep and 16 inches wide. Rake the soil in the bottom of the trench smooth.
Pour 6 inches of gravel into the trench and tamp it down.
Measure and cut the railroad ties with a circular saw. Cover the ends of the boards where you cut them with wood preservative.
Drill 9/16-inch holes into the ties for the rebar that will connect them to the ground.
Place the first tie into the trench with the help of an assistant since the ties are heavy. Lay a level on top of the tie, and tap it down by placing a wooden block on the tie and tapping it down with a hammer to level it, if needed.
Insert rebar that is 2 feet long through the holes in the ties and into the ground by driving it in with a sledgehammer.
Lay the second tie next to the first one. Place the level across the top, tapping the tie down if necessary, and drive rebar through the holes and into the ground. Continue laying ties until the first course is finished.
Place drain tile onto the gravel behind the railroad ties. This is perforated plastic pipe that will carry water away.
Set the next course of railroad ties on top of the first course, keeping the ties in each row staggered to provide extra strength to the wall. Connect the ties in the adjoining rows by driving 12-inch landscaping screws through the ties with an impact driver. Lay a third course of ties using the same method.
Fill the back of the trench where the drain tile is with gravel until it's the same height as the ties. Cover the gravel with landscaping fabric.
Install the deadmen in the wall. These are 2-foot-long ties installed perpendicular to the wall that anchor it into the ground. Place them on top of the ties, with the front edge flush against the front of the wall. Drive rebar through the back of the deadmen to attach that side, and attach the front to the wall with 12-inch landscaping screws.
Build the wall to the desired height, installing ties around the deadmen.
Backfill the gap behind the wall with dirt, placing a garden bed there if desired.