Lewis Hamilton and Charles Leclerc finished second and fourth respectively for Scuderia Ferrari HP in the third and final free practice session for the Hungarian Grand Prix.