Maybe I'm just fortunate, but I have never had a derailment in a tunnel in 8 years. I use a re-railer in the tunnel as a precaution, and I made the tunnel large enough to handle the largests loco and cars that I plan to run, so no issue there. I like to use the P6 plan. Cleaning the tracks is no issue either, as you just send the "cleaning" car in there once in a while.
Proper Planning Prevents P** Poor Performance
A word of caution ---- Any time you build a tunnel, remember that a portion of a train is sure to derail or get caught in there; also you need to maintain the track surface. You should whenever possible make an access to the tunnel (either from below or via a liftout). I hate the cliche "ask me how I know" but I assure you most of us modelers have had the problem. In other words think ahead to what you would do should trouble happen in the tunnel.
Ron K.
Like Art does, I make my mountains on my workbench first, then apply to layout. I say "apply" because some areas will be lift-outs, so they will not be glues into place, other areas "will" be glued in place. Portals always applied last on the layout after mountains are set in place.
I differ from Art in one area, and this is because I have elevated tracks in the mountains, so I "layer cake" the foam. What I mean is, I place the first layer of foam down on my bench, this may be 2" foam or 4" thick foam. I usually use 2" thick foam because it is more common and easier to get at local stores here. If the tracks are going to be on the first 2" layer, then I cut out the underside of layer #2 and sometimes #3 dependant upon the height I need in the tunnel for the locos and cars that will be running in the tunnel/s. Each layer is then glued on top of each other, carved/shaped and sculptamolded at joints to eliminate the seems, and any molded rock features are glued to surfaces also prior to installing the mountain on the layout.
Hope this helps,