When you have a DEM, looking down from straight above, lay straight sections of track, so that they intersect ... take a ruler and measure back to @ where the track curves ... make sure that the 2 rulers are the same measurement ... as one may be different from the other ... this is a guestimate location of where a curve starts
Make your curves looking straight down from above ... months later when all your curves and straights look professional and prototypical ... sink all the spline points just under the surface (as trees, buildings, and schwubbery may have thrown off the actual height) ... you can fine tune the track spline points so that they just about show through ... this is your @ spline point height in meters
Never rush a job and immediately press the "Smooth Spline" tool button ... as if you use this tool prematurely, you will permanently deform your DEM ... making it trash !
Nothing is perfect on a DEM ... it may be dozens of feet off the actual terrain height ... due to errors in track tracings ... track may be down in river channels, or rivers way up on mountain sides ... you will just have to learn to cope with such inadequacies.
Any grade that is more that 1.75% or -1.75% is probably wrong, and needs to be ironed out
A grade may be level in one spot, and +0.25% the next, followed by a +0.50%, followed by a +0.75% then level again, then down -0.25%, then down 0.50%, then down 0.75%, then down -0.50%, then down 0.25%, then level again
A grade never goes radically up 75% from level, then suddenly down -1.75% to level
Sometimes a gradient may be easy and take only a nights work ... other times a 5 mile section may take a week to iron out perfect
Much of what you have said is true of the old HOG-generated routes such as placement of roads and tracks down in rivers, or way up mountain sides.
If he's using TransDEM, the height difference maybe as little as 2-5 meters, and the track location is usually spot-on where it should be. I have found that if I place a spline point at the beginning of a curve and at the apex of the curve on a TransDEM generated route, the tracks will conform exactly to the topomap image.
Where you run into problem, mostly, is in urban areas and in those where tracks run into cuts and against steep cliffs. This is due in part to the smoothing and rounding of the Trainz mesh as the grid is much courser than the actual DEM data. This can be partially corrected in TransDEM by fiddling with the resolution settings, but it doesn't always work because our results are only as good as can be generated by the original data.
I ran into this issue in my own city. Haverhill is on a few hills. The railroad runs next to Silver Hill, one of the tallest hills in the city. On the left is the hill, on the right is a railroad grade on an embankment, and farther to the right are factory buildings. The railroad grade gets smoothed out as it runs between the factories and the hills. In some locations, the roads underneath the tracks get munched as well and the embankment is level with the road.
As far as smoothing the terrain on a DEM goes, do this after the track has been locked into place and the grade is smoothed. With some of the newer track, such as the Protrack and other by Jointed Rail, there is no need to push the track into the terrain because it does not float or does so minimally there is no need for it. But do it after the track has been smoothed and the grades verified. There's no use in doing it the grade goes up 20% on one hill because you've messed up the measurement - been there and done that because I got lost on a bunch of curves! Do this afterwards because usually if you've done things right the first time, the track will show reasonable, less than 1% grades in most cases, so the terrain under the track can be raised using the smooth terrain button. That is not to say there aren't those places where there are sometimes short steep grades. If you have one on the track, verify on Google Earth by using the TransDEM image on the terrain as a reference to the location. If they prove true, put them in, otherwise figure out what's wrong, and sometimes due to the above mentioned anomalies, some things need to be adjusted. It's the nature of the beast with our less than high resolution grid.
Keep in mind, just as you said, the surface varies and in sometimes a tiny bit a few grid points away. This is due to anomalies in the terrain and the satellite readings of the ground. If we were to raise and lower the track for each and every spline point, we would have a seesaw and roller coaster of a ride, which is totally false. The image above looks like something that has been zoomed in which shows a bit more of an exaggeration of the grades. The area in fact could be Nebraska or western Kansas near the Colorado border.
What works well is to average the grade over a distance. Use key points, or a track chart if possible to get the height information for these points, and let the track run in height between these points. In the end the grade is smoother and more realistic, if not pretty accurate too. The key here is key points such as the beginning and end of a grade, the apex of a curve, the beginning and end of a curve, and so on. It takes a bit of trial and error the first time, but once you start measuring and doing, you'll find that it goes quickly and if things have to be redone because you've messed up a baseboard by trimming the wrong one out, it's a no brainer.