A couple weeks ago, I laid my very first track ever.
This is temporary track, while I hash out my track plan.
Used Alex Plus caulk as an adhesive.
At first, I just squeezed the caulk out in small blobs - those blobs always oozed up between the ties. After a while, I started spreading it paper thin on the subroadbed with a putty knife. None of those applications oozed up at all.
Two weeks later, the layers are holding quite well, but still flexible enough that I can nick them with a finger nail - I imagine they'll come up with no particular drama. My subroadbed is 1/2" plywood. Foam might be a different story.
The downside to this is that the track must be weighted down while the caulk dries, which takes about an hour. Someone prior mentioned using hot glue - I like that idea and will try it out, as I have a bit more temporary track to lay down.