According to kinetic theory of gases, for a diatomic molecule
The mean translational kinetic energy of the molecules is proportional to the absolute temperature
All molecules of an ideal gas show random motion. They collide with each other and the walls of the container during which they lose or gain energy. So they may not have the same kinetic energy always.