Sorry for not clarifying the construction details. After you've decided on the size of the layout, assemble the 1"x2" frame: using the pieces "on edge", construct a perimeter the same size as the layout, then place crossmembers every 16" (or less) across the narrow width of the perimeter "box". Use two scews at each joint, and for 1"x2", it might be a good idea to drill pilot holes first. When you've assembled the frame, place the plywood on top, even with the edges of the frame, and use more drywall screws to fasten it down. Either start at one end or side and work across to the other, or start in the middle and work towards the edges. This will avoid causing a "bubble" or hump in the centre of the plywood that could occur if you fasten the edges down first. Use a screw every 6" to 8": there should not be a need to drill pilot holes for this operation. If you want to add foam on top of this, use construction adhesive especially designed for foam, available where you buy the foam. Personally, I would skip the foam: the plywood top will be plenty strong, and if you use the sheathing grade, it's soft enough to allow easy placement of track spikes with a pair of needlenose pliers. The foam is useful if you want to add lightweight scenery, but there is not really a need for it under the track. You can lay the track right on the plywood, or put down cork roadbed first. To lay cork on the plywood, I use yellow carpenters glue, then tack it down where required with 2" nails: just tap the nails in far enough to grab the plywood. When the glue has dried, remove the nails, then sand the top of the cork with some medium/coarse sandpaper to remove any irregularities.
It's proabably a good idea to temporarily lay your track, tacking it in place, before gluing down any type of roadbed, as this will allow you to see if your trackplan will function with the locos and rolling stock which you plan to use. (Once that yellow glue dries, it'll be very difficult to remove the cork.) When you're satisfied that everything will work as planned, mark the trackplan on the plywood, then lift the track, and lay the cork.
Wayne