Dob't know about foam. My base is 1/4" plywood and I just let super glue wick under the roadbed edges, Holds great and a knifeblade will easily remove it when necessary.
If the super glue doesn't melt the foam it might work, but foam can be a bit crumbly. Not the most stable base.