2-6-6-2, all gave you great advise, mainly the latex chalk. Depending on what you want to carve foam the foam would determine what you would use to cut it. Right now I am doing rock faces, using a bread knife, hacksaw blade, sanding block and my finger nails. Main thing to keep in mind, it is easier than most of us make it in our mind. I put off cutting for 6 months because I was afraid I would mess it up.
In this picture you can see the lines between the foam I stacked to make the cliff.

I wanted to see the lines, if you don’t want to see the lines, use latex chalk with your finger to fill it in. It is that easy.
In this picture you can see a mound I added to the bench. I ruff cut the foam to sizes, used a sanding block with 36 grit paper to final shape, chalk it down, used chalk to hide the seam again.

You can all so just paint over the foam, I use craft paint from Wally World, then sickens to taste.
Two methods I use to glue the foam together is latex chalk and or hot glue gun. Hot glue sets up very quickly so if I am in a hurry I use it. On the mountain I use both, it can be lifted off the bench so I wanted to be safe.
Road bed, chalk again, use push pins to hold the bed down around turns. I leave pin down for about a hour. I just spiked down the track to the cork road bed, I add some extra holes around turns to be safe. New section has had one spike work out in 9 months of heavy running. When you ballast, the glue will hold down the track.
There is a down side, it makes a mess! Next cutting session I am going to try this. Take a plastic trash bucket, cut a hole&nbs