Both Tokyo and Osaka are seaside cities with a number of large and small rivers, which makes them vulnerable to flooding after heavy rains.
Local government websites have hazard maps that demarcate the areas most likely to flood, especially when major rivers overflow. Unfortunately, for people who don't read Japanese, only few of the local maps are in English.
In general, dark blue denotes areas most likely to flood. However, the color legend of the maps does vary from ward to ward so if you can't read Japanese, please note the numbers of water height to gauge the water-level legend or ask a Japanese speaker to help you.
When severe weather conditions occur, it's recommended that you check the official advisories and warnings on Japan Meteorological Agency website.
For a detailed map of other regions, see the hazard map portal of the Japan's transportation ministry.