Of course you knew I would chime in. But you may be surprised by the answer.
On a time basis, its Budapest. 8 hours vs 10 hours to Prague. Either is a long trip. I haven't done the train from Zakopane, but I hear it goes through beautiful country on the way to Budapest. Might be the same to Prague, I just haven't heard. The other consideration other than time might be arrival time. Does one get you in early enough to see more the first day?
On pedestrian feel. Yes, Old Town is wonderful to walk for a day. Then for me at least it ended. Sure there is a lot more to see in Prague than Old Town, but the common tourist spots are somewhat limited in Prague so you will have to do some research to stay busy for three days if you are like me. If you just enjoy the stroll and exploring, it might work well for you. Budapest will require that you buy a Travel Card and tour the city. But as I mention below, with Budapest it isnt a tourist zone, its the city you go to. The trams are fun in both.
The history and the architecture. Prague has the wonderfully well preserved medieval Old Town; it is like an architectural museum, but it is a small area and it exists only for tourists for the most part. Yes, unaffected by the war. Budapest didn't much exist in medieval times so war or not there wouldn't be much to see if you are looking for medieval. Generally speaking 90% of the buildings were hit during the war, but 80% survived and were repaired. This is no museum. This is an occupied, fully working 1890's city. Museum or ongoing culture, you decide. Both valid.
Jewish history is big in both. Prague's Jewish quarter was preserved by Hitler to create a museum to a dead race. It is a pretty amazing neighborhood museum. Again, Budapest is no museum, it has a vibrant existing Jewish history that you step over on almost every street corner (a bit of an exaggeration).
Cold War History; alive and kicking in both.
Food: Budapest better x 5
Cost: Budapest probably a bit cheaper
Days on the ground: 3 is sort of a minimum in Budapest; Prague, maybe 2. If you only have 3 nights, its Prague.
Prague, more polished. Budapest at bit more "used".
Culture: I give Budapest a slight edge, just because there are more venues. But plenty in Prague for a short stay.
Drinking and Beer Halls: Prague x 3 (much more of a party town)
Age of tourists: Prague somewhat younger. The over 40 crowd I think enjoy Budapest more, the under 30 I bet will choose Prague (okay, gross over generalization).
Tourism crowds: Prague worse because the tourist zone is so small. But who knows with COVID.
Help planning on the RS forum: Budapest x 10 LOL
Seriously, you cant go wrong with either.