Plaintiffs claim this year’s record heatwaves have caused economic losses and put many at risk of crippling heatstroke.