There was one layout that I saw that used the foam in a suitable manner - 2" foam was used and installed vertically side by side for a single track support.
This would be ok if you were going finish the rise and elevation as terrain or perhaps carve it as a viaduct. 4 pieces wide for a double track could get expensive.