Evolution of electron and proton temperatures in a flaring loop