A heatwave continued to stifle Japan on Sunday as the temperature topped 40 degrees Celsius in two cities, leaving at least four people dead over the weekend, officials and reports said.