Is it strong enough to lay track over and is good for painting and scenery?
Use the extruded foam,(usually pink or blue) NOT the beaded, (usually white) stuff.
Yes you can lay track on it. Use latex caulk as adhesive and water based paints. Beware any solvent based substances as they will EAT the foam.
Of course it needs to be well supported by a grid or even better by plywood.
It will still need a sub roadbed of plywood or such under it,and yes while messy when craving or shaping its excellent for scenery though the extruded foam is better than the beaded white type.
I use both the beaded and extruded polyboard (styrofoam) and find them both to be excellent as a track base. As mentioned above you will need to have it on another base, such as plywood or thick foam.