Forget the nails and screws. I used strips of two-sided carpet tape to secure Woodland Scenics vinyl roadbed and Atlas O track to a styrofoam sub-roadbed on my permanent layout. I've been operating my trains, including heavy steam locomotives, on this layout for 12 years without any problems. It holds the track and roadbed great and it's easy to pull up if you need to make changes.
Just put a 3-4" strip at every other track joint. If you have a long 40" straight track put a piece in the middle too.