Yes, there is evidence that is the case[0]. Part of the abstract:
"We provide the first evidence that cumulative heat exposure inhibits cognitive skill development and that school air conditioning can mitigate this effect. Student fixed effects models using 10 million PSAT-takers show that hotter school days in the year prior to the test reduce learning, with extreme heat being particularly damaging and larger effects for low income and minority students. (...) Without air conditioning, each 1°F increase in school year temperature reduces the amount learned that year by one percent. "
[0]: https://scholar.harvard.edu/files/joshuagoodman/files/w24639...