Well it registers gravity, so you can detect i.e. driving off a cliff. ;)
What helps is that tunnels don't usually branch, so once you're in it, your path is usually quite predictable.
TomTom maps also have a statistical model of what speed is expected along each stretch of road by hour and weekday/weekend (not 7 individual days, but 2 kinds of days). But I don't know if it uses that to help estimate your expected speed when dead reckoning, it's actually for route planning.
One of my co-workers came up with the great idea of gamifying driving: maintain a real time speed leader board, showing the top ten speeders along any stretch of road! So on every road in the world you could compete with other TomTom users who drove it. Kind of like checking in with 4Square, but more fun and dangerous! TomTom legal did not approve.
I suggested gamifying and monetizing driving with TomTomagotchi, a virtual pet that gets depressed if you don't drive it around enough, begs you to visit interesting landmarks and sponsored points of interest, like driving through McDonalds to feed it, or through the park to let it take a shit, or driving fast enough to make the leaderboard to entertain it. I'm sure Bandai's lawyers wouldn't approve.