What are the best exercises for someone who had played the piano for 3 years but has had a 4 year break and wants to get back into playing, Hanon or Czerny?
Both are fine. Choose one. You will not miss out on anything if you choose one over the other. The most important thing for you is daily, quality practice. Choose literature that is playable but challenging.
This question is 8 years old and I'm no expert but I thought I'd share my thoughts:
My teacher gave me both Hannon and Czerny exercises. Hannon mostly focuses on dexterity, speed, and flexibility. A lot of musicians sometimes go back to Hannon to warm up. It consists of the same pattern in both the left and right hands that should be performed once ascending and then descending that you have to reach 108bpm. Czerny is mostly focused on technique. Some of the practices are "Identifying notes", "Exercises spanning more than an octave", "Exercises for applications of sharps and flats", etc. In a sense, it is similar to Beyer. So they have different purposes.
Personally, if I had 3 years of experience but had been away from the piano for 4 years, I would start with Czerny but add Hannon on the way. As @mjibson mentioned, what matters is consistent focused practice.
I saw this question come back into activity, and I thought I had a small but practical bit of advice:
Czerny books like Recreations and the other short tunes are nice for classical style. If they are too easy as study pieces they also make good sight reading. The down side is most of the stuff is in simple keys of only one or two sharps/flats.
If Hanon is used as intended, you play the stuff in all keys. So that gives you exposure to keys you will never encounter in Czerny.
The thing I don't like about Hanon is the stuff is too harmonically generic. You could just as well make up on the spot a scale/broken chord figuration on a two chord pattern or cadential formula and then harmonically sequence it through all keys. You could even take a two chord pattern from Czerny and run it through sequencing and keys. Either one will probably be more musically interesting than Hanon.