I'm not going to use a table as such, I'm building a 7' x 9' "L" shaped switching layout. The layout will be on top of book shelves.
With regard to what Fred said about modular groups having adjustments for leveling, all we can do with modules is adjust the legs of modules to make the benchwork parrallel with the floor of whatever building we set up in. The club I'm in set up for a GAT Show at the Los Angeles County Fairgrounds once where there was a 3% grade built in to the floor of the building! We discovered that we needed "helper" service to get a train around the layout, and the only way we could do any sort of switching operation that weekend was to put one truck of any car we uncoupled on a siding in the ballast to keep the car from rolling away.
Regarding plywood vs foam, as Fred said ply wood is not very stiff. That is one of the things that makes it nice for "cookie cutter" style layouts. You can bend it into grades and get nice transitions from level to grade. If you are going to put your train board on another table to operate, like a dining table, that means you will put it away after operating, if you want to keep peace with momma! Making the table with a thick enough piece of plywood to keep the sag out will make the layout too heavey to move comfortably. Use thinner plywood to keep the weight down. Then cross brace it with 1x2 lumber every 12 inches or so. You can actually use something as thin as luan door skin material if you use cross braces every 12 inches and have a light weight rigid structure. If you don't have or don't know how to use a router to inset the top on the table, use 1x4 lumber for your perimiter framework, then make cleats from 1x3 lumber and screw them to the inside of the 1x4s. A couple of short 1x3 cleats on each side and end of the frame with 1x2 cross members and a 1x3 cleat across the inside of each corner will yield a strong but light weight train board in wood.