Fellow Brit and Team Sky rider Froome, seeking his fifth Tour win, is a further 32 seconds back.
In the end, it proved decisive as Thomas, Dumoulin and the rest of the group were unable to catch the Lotto-Jumbo team rider.
But Thomas added: "The team here is super strong, just look at the individuals we have. guys who are very strong in the (one-day) classics, climbers like Egan Bernal, who is the brightest climbing talent in a long time".
The 200-km stage featured six categorized climbs, culminating in a final 20-km decent to Laruns. Geraint Thomas would have been three school years above Gareth Bale and Sam Warburton at the Cardiff comprehensive but is a don't-do-anything-daft-now time trial away from arguably surpassing their achievements.
"As for tomorrow, I take nothing for granted", Thomas says about the time trial to come.
"I have pain everywhere, but I'm happy that I can still keep racing".
A pair of Dumoulin attacks on the final climb were matched by Thomas, with Bernal also brilliantly rescuing Froome when Roglic appeared to have shaken off the defending champion.
"I had legs today", Roglic said. Thomas was next to finish after sprinting ahead of Bardet and Dan Martin to take the bonus seconds, extending his lead.
Roglic, who also excels at time trials, showed courage on a twisty descent made more hard by clouds and fog hanging over the Aubisque.
But the descent prompted a dash to the finish and Roglic moved again, the former ski jumper this time getting clear to take victory and leapfrog Froome in the standings.
But he picked himself up from the side of the ride in the Pyrenees and finished 26 minutes behind stage victor Nairo Quintana of Movistar in 134th place. "I only saw him coming back on to the road".
"I don't think so", he said. "I can't comment on things on which I don't have influence over", he said. "I didn't notice anything unusual".
Mountain classifications leader Julian Alaphilippe was first over the Aspin and Tourmalet as part of an early breakaway. All he had to was stay alongside Dumoulin to take a substantial lead into the team trial.
On Friday (Saturday NZT), he was in full control of a thrilling mountain stage that was set ablaze with attacks and chases.
Bore da! Whitchurch High School could soon be adding a Tour de France victor to their list of notable alumni, alongside three-time Champions League victor and Grand Slam-lifting and British and Irish Lions captain.