Water Heater - Electrical Fire - Safe to replace thermostat to try to fix?
A loose connection can cause the wire to overheat. Now with the terminal appearing to be damaged it would require a new wire and possibly a new thermostat. If you can clean the terminal and it is not pitted you may be able to re use the thermostat but the wire needs to be replaced. These connections are high current draw and your wire was not wrapped around the screw even if tight the point of contact is two small and not code compliant without being wrapped. Exhibit 110.4 in 2014 NEC hand book 2/3 minimum not over lapping.