I wouldn't pick a destination based on potential heat. Heat difference is usually not big, and you can get rain and cooler weather in AMS any time of year.
You already know AMS.
By comparison Berlin is much bigger geographically. And the areas you'll want to visit are all over the city. You'll need to use public transit for sure, and will likely tend to shuttle from site to site as opposed to wander. It's gentrified, but is still a punky place, and does have the big city driftwood of all sorts.
Berlin IMO is more site-oriented, particularly for a family with kids the age of yours.
A good family strategy to visit Berlin is to stay in Potsdam. About 20 minutes to Berlin by train high frequency (you barely wait). Potsdam was a provincial capital, and summer playground for the aristocracy, and it show. It is clean, attractive, fully-walkable, and LOADED with good living amenities. It's a pricey-pram, high-end coffee, drinks on the patio sort of place. It is right next to (like easy walk) a massive formal park with beautiful imperial summer palaces. You can rent bikes and ride traffic free there, and easy/safely elsewhere. There are big lakes/waterways all around, and you can swim (Google Potsdam Strandbad), rent paddle boards, rent a boat etc. Good family town, many 2-3 bedroom apartments for short term rental, etc. Google up photos of Potsdam and look beyond the palaces and park - it's a nice little city!
And you are a short train ride to Berlin, where you can hub seamlessly to more local transit if need be. SO you can to day trips most days somewhat efficiently striking at just the things you want to see.
Vienna: Would you like to go to Paris, but prefer a smaller, more manageable, safer and cleaner city? Vienna has the head-exploding Grand European beautiful stuff in spades, but also a relatively easy city. it also has folk culture right in the city, not just high art. You can ride a streetcar to where the city turns hilly and walk the through gorgeous vineyards and pretty wood to a wine tavern. You can take the subway down to the river island and swim in a huge outdoor pool complex with wave pool, slides, massive lawns and maybe a kilometer of riverfront. Great markets and many village-like street too. Year round historic fun fair. It's a supremely high-culture town but built on a folk foundation.
Size-wise Vienna feels halfway between massive spread out Berlin and tightly-packed Amsterdam.
If Vienna choose where you'll stay wisely - The neighborhood around your accommodation will dictate your experience. The transit system is so good (particularly if you take 15 minutes to view videos and get it sorted in your head) that I joke to my spouse that you think about being somewhere and in 12 minutes you materialize at that site. So in terms of expediency getting to major sites and, It doesn't make that much difference where you stay in Vienna. It's easy to get from any place in the city to any place in the city. So spend your 5 days in a location that immediately serves your family's day to day needs and wants, and you will quickly come to love "your" district.
And again, you know AMS.
Good news is not a bad choice in the lot - all great places and completely worthy of your visit.