Any bookshelf design is strong enough for a model train.
Floating shelf type use steel rods drilled into studs. No drywall anchors required.
The trick is to ensure the outer edge stays horizontal and perpendicular to the wall, no sag. Width of the shelf is the most significant loading factor. 18" deep would be wide.
There is another style I used for kitchen shelves which is a slotted wedge shaped aluminum bracket you screw to the wall inside the slot and then simply stick accurately dimensional plywood sheet into that slot. Very strong.
A google search for this style shows several variations of U or W Channel supplets
L shape adds some strength but the longer the L the less you can rely on that support. On the other hand just one L or Wedge shaped bracket under the otherwise floating shelf increases load capacity out of all proportion to its size.
The benchwork itself is the heaviest part of the layout, ironically.
Just by the by that load rating for wall anchors will be vertical in sheer. For floating shelves the main loading on the wall fasteners is horizontal pulling the fastener out of the wall. That's how cantilever forces work. That's why even a small flange screwed into the wall above the fulcrum point against the wall adds so much strength. Use the longest and most robust fasteners above the shelf. Also why the bottom fastener on standard L brackets does almost no work.