Listen to this article
Overnight rain meant the track was still damp in patches for Saturday morning's second practice session, but those had cleared by the start of WTCR qualifying at 11.45am local time.
Girolami, who had set the pace in first practice and would have topped FP2 but for his lap being chalked off for track limits, looked on course to usurp Cyan Racing Lynk & Co driver Muller at the head of the order with five minutes remaining.
But the Argentinian aborted that lap and headed back to the Munnich garage before attempting one final run in his Honda.
That decision paid off, as Girolami set a best time of 1m52.586s - beating Muller's previous benchmark by 0.171 seconds - with less than two minutes remaining.
Girolami's teammate Esteban Guerrieri had a scruffier session and only recorded a first timed lap with five minutes left on the clock, but improved on his final run to claim third behind Muller.
Aurelien Panis was an excellent fourth in his Comtoyou Racing Cupra, ahead of Muller's Lynk & Co teammates Yann Ehrlacher and Thed Bjork.
Johan Kristoffersson recorded what was comfortably the best qualifying result for the Sebastien Loeb Racing Volkswagen team at the start of the 2019 season, securing seventh on the grid.
Audi's leading runner was WRT driver Jean-Karl Vernay in eighth, with a late effort from Augusto Farfus (BRC Racing Hyundai) separating Vernay's car from the similar Comtoyou Audi of Frederic Vervisch.
Daniel Haglof (PWR Cupra) and the second Volkswagen of Mehdi Bennani were 11th and 12th, ahead of home favourite Norbert Michelisz and his BRC Hyundai teammate Gabriele Tarquini.
The fourth Lynk & Co of Hungaroring rookie Andy Priaulx was 15th, while Kevin Ceccon was the Team Mulsanne Alfa Romeo outfit's lead representative in 19th.
|1|| Nestor Girolami ||Honda||1'52.586|
|2|| Yvan Muller ||Lynk & Co||1'52.757||0.171|
|3|| Esteban Guerrieri ||Honda||1'52.893||0.307|
|4|| Aurelien Panis ||Seat||1'52.955||0.369|
|5|| Yann Ehrlacher ||Lynk & Co||1'53.042||0.456|
|6|| Thed Björk ||Lynk & Co||1'53.065||0.479|
|7|| Johan Kristoffersson ||Volkswagen||1'53.158||0.572|
|8|| Jean-Karl Vernay ||Audi||1'53.217||0.631|
|9|| Augusto Farfus ||Hyundai||1'53.267||0.681|
|10|| Frederic Vervisch ||Audi||1'53.274||0.688|
|11|| Daniel Haglof ||Seat||1'53.286||0.700|
|12|| Mehdi Bennani ||Volkswagen||1'53.289||0.703|
|13|| Norbert Michelisz ||Hyundai||1'53.290||0.704|
|14|| Gabriele Tarquini ||Hyundai||1'53.298||0.712|
|15|| Andy Priaulx ||Lynk & Co||1'53.397||0.811|
|16|| Mikel Azcona ||Seat||1'53.486||0.900|
|17|| Rob Huff ||Volkswagen||1'53.496||0.910|
|18|| Attila Tassi ||Honda||1'53.548||0.962|
|19|| Kevin Ceccon ||Alfa Romeo||1'53.659||1.073|
|20|| Nick Catsburg ||Hyundai||1'53.690||1.104|
|21|| Ma Qing Hua ||Alfa Romeo||1'53.780||1.194|
|22|| Niels Langeveld ||Audi||1'53.845||1.259|
|23|| Tiago Monteiro ||Honda||1'53.903||1.317|
|24|| Gordon Shedden ||Audi||1'54.048||1.462|
|25|| Benjamin Leuchter ||Volkswagen||1'54.078||1.492|
|26|| Tom Coronel ||Seat||1'54.213||1.627|
|27|| Tamas Tenke ||Seat||1'57.067||4.481|
|View full results|
WTCR electrification at least "a few years" away
Hungary WTCR: Girolami holds off Muller to win