The Formula 2 championship leader lapped the Hungaroring in 1:17.746s, on soft tyres, in the final minutes of the eight-hour session to go 0.088s faster than Vandoorne.
Vandoorne had set the pace in the morning before suffering a mechanical problem with his McLaren-Honda, spent most of the afternoon in the garage.
He got out in the latter part of the session, with McLaren hoping to gather data on a series of new parts, and set his best lap on the ultra-soft tyres.
Valtteri Bottas, carrying out tyre testing for Pirelli, was 0.986s off the pace in third in his Mercedes as he clocked the most laps of anybody with 155.
GP3 racer George Russell completed his first full F1 test with the fourth quickest time in the other Mercedes, improving on his morning time by nearly a second and clocking up more than 100 laps.
Lance Stroll, filling in for an unwell Felipe Massa at Williams, was fifth with a tally of 137 laps and 2.1s off the pace, followed by Force India's Nikita Mazepin.
Mercedes DTM frontrunner Lucas Auer took over driving duties at Force India in the afternoon and ended up ninth quickest.
Nicholas Latifi, who will hand his Renault over to Robert Kubica on Wednesday, was seventh for Renault.
Toro Rosso's Sean Gelael, who had his running cut short because of a problem but recovered track time in the afternoon when he focused longer runs and testing development items, was eighth.
Haas junior Santino Ferrucci ended up 10th quickest, ahead of Red Bull's Max Verstappen, who improved on his morning time by 1.4 seconds, with Gustav Malja propping up the timesheets for Sauber.
The second and final day of the test takes place from tonight (AEST).
Results: Post-Hungary test: Day 1