Dumoulin (Sunweb) beat defending champion Chris Froome (Sky) by a single second to take the stage while Thomas took a conservative line to finish 14 seconds later for third.
“That was crazy! I can’t believe it," said Dumoulin. "I still thought Froome was one second ahead when I crossed line. It has been an amazing last day, I was so nervous. I had such a hard time yesterday, but today it has just been great to take the stage win.”
Barring incident, all three riders will take to the podium in Paris on Sunday with Thomas leading Dumoulin by one minute and 51 seconds and Froome third at two minutes and 24 seconds.
Third overall before the time trial, Primoz Roglic lost his place to a resurgent Froome after a weaker than expected performance against the clock. He finished 8th on the stage and one minute 12 seconds behind the winner falling to fourth on the general classification.
The best placed Australian was Michael Hepburn (Mitchelton-Scott) who sat on the stage leaders hot seat for one hour and 48 minutes after a high-quality ride covering the 31km from Saint-Pée-sur-Nivelle to Espelette in 42 minutes 15 seconds to claim 10th.
The first man on the road was Lawson Craddock (EF Education First Drapac) who has been riding last since his heavy crash on the opening stage. Jay Thompson (Dimension Data), Amund Groendahl Jansen (LottoNL-Jumbo) and Marco Marcato (UAE Team Emirates) set new best times on the line until Hepburn finished.
Marc Soler (Movistar) was first to better his time, albeit by only five-hundredths of a second. Soren Kragh Andersen (Sunweb) was next to set a significant time at the average speed of 44.6km/h but didn’t last long in the lead as Michal Kwiatkowski (Sky) rode one second faster.
The next phase of the stage was a gripping fight between all of the key general classification riders before Dumoulin emerged as the best against the clock.