He could do no better than finish 11th – just a couple of seconds behind a point-scoring finish - despite having a car that looked capable of a strong finish on the tighter Hungaroring circuit.
Teammate Pierre Gasly finish sixth.
It continues Hartley's run of improved form however and he should take some confidence into the summer break.
"I'm disappointed not to score points after a strong qualifying," the Le Mans winner said. "I had a great start but decided not to dive up the inside of Gasly which ultimately lost me a place to Magnussen.
"My race was then destroyed as I was stuck behind Sainz during the first half of the race when he was on a harder tyre. We then reacted too early to Hulkenberg pitting behind and putting the Medium tyre, which didn't give me the best performance. I fully understand why the team split the strategies but today it didn't work out for me.
"I made no mistakes, I had a good start but unfortunately no points to show for it. I'm happy for the team to score more points which is a nice reward for all the hard work over the last months."
The win was a big boost to Hamilton's title charge.
"We came here knowing that the Ferrari would be real quick this weekend, but to come out with these points we'll definitely take as a bonus," Hamilton said post-race.
Vettel had been hoping to make his tyre strategy work late in the race. It played out that way as he managed to work his way past Bottas however the plan involved beating his title rival instead.
"It was tricky knowing when to come in and then we had an issue at the pitstop," Vettel said. "I was sitting back and waiting and trying to line up everything on the last 10 laps [on Bottas]. And it worked."
Vettel saw no problem with the contact he had with Bottas.
"I was surprised because I was already ahead," he said. "I was just trying to break to just cover the inside line, not run in too deep. [Then] I got a hit from behind so I wasn't sure what was going on and I was looking in the mirrors and I saw that Valtteri was there with Kimi. And after that it was clear - the car wasn't broken and we could carry on."
The championship takes a break for four weeks before the Belgian Grand Prix at the end of August.