While not foamboard, I did a similar thing in the late 70's.
Warren Backhouse,Peter Cole and myself built an exhibition layout called 'Whitton Road' to replace 'Bargo' for use at the Canberra Exhibition. I came up with an idea to perhaps solve the expansion/contraction issues with track laid in freezing cold sheds and exhibited in hot buildings.
The layout used 3" cushion foam on top of 2 by 1 frames for the baseboards, and scenery, including rocks etc was made from the same foam. A range of powder colours from the art store and dirt were the other main ingredients. Track etc was glued to the foam, however I can't remember what glue I used. While not as light as Styrofoam or similar, as a bonus, the layout scenery suffered no cracks from bouncing around in the back of the trailer and no issues with trackwork resulted.