wen heat is given to a body it can be converted into internal energy or as work...if the system does more work than the supplied heat then the internal energy decreases resulting in the decrease in temprature...if the heat is used in phase transition then the temperature of the body remains constant
It is true that heat supplied to a body gets used up in doing work and increasing internal energy but it is also true that work done can never exceed heat supplied. So if heat is provided to a body, its temperature definitely increases.