A few tips if you don't mind , since I worked with Foamboard before on my last layout & learned from a few mistakes
First painting...
I would highly recommend spray paint or airbrush on it in very light coats & let it dry between coats otherwise the Foamboard surface (paper) will get to wet & will peel off
If you want to paint brush or paint roll the Foamboard you will have to remove the surface paper first by soaking the foamboard in water until the paper start to comes off on it own then you only be left with the foamboard that you can then paint with a roll or brush...
You always can paint roll over the foamboard without removing the surface paper if you go in very light coats & if the foarboard is securely "glue" on the table surface otherwise it will start to be uneven & will lift up here & there when it dries...
You can use hot glue to glue the foamboard on the table but I would suggest using insulating film tape it will hold really well & will be make foamboard easier to removed if you ever change your layout...

Last thing I learned after some testing is that even the 5mm foamboard which is 1mm lower then the Carrera Go track change nothing for cars to drift/slide through the curves so I went through lots of effort to make the foamboard flush to the same thickness of Carrera track which was not necessary as the 1mm difference won't affect the cars drifting through the curves
Mikey