A good plan and I totally get the night train. Something to talk about for years. My last one was Budapest to Kyiv back in January. I still show the pictures of the sleeping compartment and the train. Lifetime experience.
How old are the kids? Boys or girls? I can suggest a few things they might like (mom and dad too).
I am guessing you are locked in on the dates, cause if you put it off two weeks and were here on 20 August you would be here for the biggest and most beautiful celebration of the year.
If you click on my name it takes you to my profile page. There you will find a bit more on things to see and do in Budapest.
Tuesday 5 August arrive in Budapest 2pm.
Take the Express Bus to town (or cram into a taxi).
Your hotel or AirBnb is along Andrassy ut (LOL) and you have 15 day passes on the public transportation so its a walk or a ride up Andrassy ut on the M1 (walk). Explore Andrassy ut that afternoon, maybe the balloon ride, and make a run down to the river in the evening for the views and the lights (although sunset is sort of late in August).
Wednesday 6 August District V attractions.
You can really do these in any order, this is just me tracking the zone you need to visit.
Thursday 7 August, District VII and VIII attractions
Friday 8 August, Lower Buda and Szentendre trip
Saturday 9 August, Buda Castle District day.
Sunday 10 August catch up on what you missed until train departure time.
Depart for Nyugati station about 1 hour before to give you time to poke around the station ... maybe go to the McDonalds.
Monday 11 August arrive Prague very early. So if you are staying in an AirBnb you maybe need to find a luggage storage locker facility.
Tuesday 13 August wish you were still in Budapest LOL
ETC..... I don’t do Prague.