June 27 - Arriving by train?? to Budapest (2 nights) June 29 - Over
night train to Prague (1 night)
You said train with question marks. I think the train is the best way to go.
Most hotel check in will be 2pm. But you can leave your luggage and go exploring; cause you havent got much time.
Given the short duration of your stay, I would suggest staing on the river. Either the Intercontinental or the Marriott. If those are too pricy, the next closest to what you will have time to see is maybe the Hotel Moments. Failing that, find a place along Andrassy ut as the M1 metro will keep you well connected.
The first half day I would do Andrassy ut, maybe with a tour of the Opera and a stop at the House of Terror if either light your fire. But walk all the way to the end as its the prettiest street in Budapest. At the end is the Széchenyi Bath House if that is of interest. The return trip to the hotel can be on the M1 wich runs under Andrassy ut, but if its past dark, walk it for the lights or at least walk part of it.
For your full day think about using the 2 Tram to visit the Parliament, then backwards to the Great Market Hall, then the 47/48/49 tram to Great Synagogue and do the tour. From there you might want to wander District VII which is where the WWII Jewish Deportatio Ghetto was located. Also where you find some nice beer bars, wine bars, restaurants and the Ruin Pubs.
Your final half day I suggest the Basilica square and the places between that and your hotel.
All this moving around will take public transportation. For that you get a 72 hour Budapest TravelCard at the train station when you arrive. The office (and machines if you want) that sell them is located at the bottom of the stairs in the center at the front of the train station.
Welcome to the forum.