If the average kinetic energy of substance A's molecules is higher than the average kinetic energy of substance B's molecules:

Thermal energy will be transferred from substance B to substance A.

The temperature of substance B will be higher than substance A.

Heat will transfer from substance A to substance B.

The temperature of substance A is lower than that of substance B.