If you're going to fasten it to the wall, why not just build open grid benchwork? You'll use less lumber, and you can use plywood, foam, or "cookie cutter" type sub-roadbed. I built my layout using 1"x4" pine, 16" o.c. These "table tops" are supported by 2"x4" legs and framework, bolted to the walls. (I used 2"x4"s because that's what I had left over after building my house.) I also used 3/8" plywood to build storage shelves under most of the layout. The 1"x4" is put together with drywall screws. In some areas, this was covered with plywood, while other areas got strips of subroadbed cut from sheets of 3/4" plywood. Elevated track was raised by screwing 1"x2" or 1"x4" scraps, vertically, to the crossmembers of the open grid. I'm planning to build a second level of the layout this winter. This will be 1"x2" open grid, supported on custom-made angle brackets bolted to the wall. Table top will be all 3/8" plywood, and there'll be fluorescent lights hung beneath the gridwork, to illuminate the parts of the layout underneath.
Wayne