The flights are about as good for both. From London it's about 2 hours to Prague and 2.5 to Budapest, from Frankfurt about 1 and 1.5 hours, and from Warsaw 1.5 to both, all year round. Belgrade is closer to Budapest, about 1 hour against 2 to Prague.
The airport run is the small edge for Prague. Václav Havel Airport is about 12 km from the center and the 59 trolleybus (about 35 minutes to Nádraží Veleslavín) and the 100 bus (about 45 minutes to Zličín) reach metro stations on a normal PID ticket (50 CZK for 90 minutes). The AE express to the main station is a separate 200 CZK. Budapest's airport is about 16 km out, and the 100E express bus to Deák Ferenc tér takes about 40 minutes (BKK) and has its own fare of 2,500 HUF. The survey's return airport transfer was about 4 EUR in Prague against 15 EUR in Budapest.
In town you won't need a car in either. Prague has three metro lines and over twenty tram lines, and the old town is walkable. Budapest has four metro lines, trams along the river and the HÉV suburban trains, with 24 and 72-hour BKK cards.
Taxis are the trap in both. The UK Foreign Office says some taxis in Czechia charge high prices and tells you to check the rates on the side of the car, and for Hungary it advises using reputable local taxi companies. So order through an app or a known company in either city, and at Budapest airport don't accept rides offered inside the terminal.