During a Formula One season that has already enjoyed its fair share of twists and turns the rollercoaster ride showed no signs of letting up in qualifying for the Hungarian Grand Prix. Fears that Mercedes might have developed their car into a dominant position were comprehensively dismissed when Sebastian Vettel and Kimi Raikkonen led a Ferrari one-two. In their wake they left Lewis Hamilton having to accept that the car in which he crushed the opposition at the British Grand Prix could manage only fourth in Budapest, one place behind his team-mate, Valtteri Bottas.

Mercedes had previously struggled with their balance, set-up and tyre temperatures, with the team’s executive director, Toto Wolff, describing the car as a diva. But after Silverstone they were hopeful that development had unlocked a stable platform. On this evidence they still have a way to go yet and, while they will be unhappy with that state of affairs, in a championship that is finely balanced with Vettel leading Hamilton by one point it makes what has been a fascinating season even more intense. Hamilton admitted they had been outclassed. “I don’t think there was any moment that we had a shot at pole,” he said. “We couldn’t match Ferrari’s time today.”

Hamilton had aborted his first hot run in Q3, having gone wide through turn four, and had repeatedly noted that he was unhappy with the balance of his tyres. He was also suffering from vibrations, although he acknowledged that it had been Ferrari’s pace that had really made the difference. Hamilton was ultimately half a second back from Vettel – a gulf of a margin – and the British driver said he did not expect to be able to bridge it. “I think it is going to be an easy breeze for them tomorrow,” he added.

Through the fast corners of power-hungry Silverstone Mercedes were in a class of their own but at the Hungaroring, where aero and downforce are at a premium, Ferrari proved they are still on the front foot. Particularly in Vettel’s hands, the car has shown good balance, proved undemanding to set up and has been strong through the corners from the moment it broke cover in testing.

Wolff acknowledged that the battle with Ferrari is still one of cut and thrust. “The DNA of our car seems to be running more stable on the faster circuits and Ferrari are doing well on the slower, twisty circuits,” he said. “It is still motor racing and lots of things can happen but from pure car performance it is about damage limitation.”

Fans cheer as Raikkonen rounds the final corner during qualifying. Photograph: Mark Thompson/Getty Images

Vettel caused said damage with a superlative run. His first in Q3, with a time of 1.16.276 which smashed the track record of 1.18.436 set by Rubens Barrichello in 2004, was untouchable and he said it would have been hard to better. “The car has been incredible all day,” he said. “We made a good step forward. I like this track a lot and it’s been really enjoyable. It’s a front row for us so we’re looking forward to tomorrow.”

Overtaking is difficult but not impossible at the Hungaroring and Hamilton has won here from fourth once before, with McLaren in 2009. The Mercedes, however, does not like running in dirty air and, with Ferrari at an advantage, he will realistically have to look to make up places from the start or through adopting an alternative strategy. The British driver has yet to lead the title race alone this season and Vettel has put himself in the perfect position to ensure he holds the lead as F1 goes into its summer break.

Red Bull’s hope that upgrades for Hungary would allow them to mix it with the leaders at this track in qualifying were dashed with Max Verstappen and Daniel Ricciardo in fifth and sixth, half a second back from Vettel.

There was, however, considerable satisfaction for Paul di Resta, who was drafted in at Williams after final practice to replace Felipe Massa, who was suffering with an illness. It was the British driver’s first competitive run in an F1 car since the Brazilian Grand Prix of 2013, when he was racing for Force India. Di Resta is the Williams reserve driver and had little time to prepare for qualifying in the new F1 cars, as Massa’s withdrawal was announced only after the third practice session. He did well to put in a clean run to finish 19th, seven-tenths of a second back from his team-mate, Lance Stroll, in 17th.

Full qualifying results

1) Sebastian Vettel (Ferrari) 1m16.276s, 2) Kimi Raikkonen (Ferrari) 1m16.444s 3) Valtteri Bottas (Mercedes) 1m16.530s 4) Lewis Hamilton (Mercedes) 1m16.707s 5) Max Verstappen (Red Bull Racing) 1m16.797s 6) Daniel Ricciardo (Red Bull Racing) 1m16.818s 7) Nico Hülkenberg (Renault) 1m17.468s 8) Fernando Alonso (McLaren Honda) 1m17.549s 9) Stoffel Vandoorne (McLaren Honda) 1m17.894s 10) Carlos Sainz Jr (Toro Rosso) 1m18.912s 11) Jolyon Palmer (Renault) 1m18.415s 12) Esteban Ocon (Force India) 1m18.415s 13) Daniil Kvyat (Toro Rosso) 1m18.538s 14) Sergio Pérez (Force India) 1m18.639s 15) Romain Grosjean (Haas) 1m18.771s 16) Kevin Magnussen (Haas) 1m19.095s 17) Lance Stroll (Williams) 1m19.102s 18) Pascal Wehrlein (Sauber) 19m19.839s 19) Paul di Resta (Williams) 1m19.868s 20) Marcus Ericsson (Sauber) 1m19.972