Hamilton has won four of the last five races and trails Rosberg by one point heading into Monday's race, down from the 43-point deficit between the pair after May's Spanish Grand Prix.
He jointly holds the record for most wins at the track with Michael Schumacher.
Former Hungarian Grand Prix winner Daniel Ricciardo, fifth in the morning, ended the day second fastest, half a second adrift of Rosberg's mark.
His Red Bull team, the only ones to beat Mercedes this year with Max Verstappen's win in Spain, are hoping to pose a genuine threat to their German rivals at a circuit that should suit their car.
Sebastian Vettel, who won the race last year, was third in his Ferrari ahead of Verstappen. His team mate Kimi Raikkonen was sixth.
McLaren, who are also expecting an improvement in form, ended both sessions seventh and eighth with Fernando Alonso ahead of Jenson Button, on a track where both claimed their maiden Formula One wins.
The Force India cars of Nico Hulkenberg and Sergio Perez rounded out the top 10.
Hamilton's accident was the only high-profile incident of the session, run in hot conditions with track temperatures in the forties.
The crash prompted a brief red-flag stoppage as track marshals worked to the repair damage to the barrier.