Thermal energy is an equation of state, it is the total energy contained in a system due to the random motions of all of its constituents (in the center of mass frame). Heat is energy in transport, and it is not an equation of state. It is the energy transferred from one system to another that is not done by work.