As air rises, the pressure decreases. It is this lower pressure at higher altitudes that causes the temperature to be colder on top of a mountain than at lower elevations.
Even though warm air rises it has to do with the pressure. When you go higher in elevation there’s more and more air pressure that’s why you can only be so high before you need an oxygen mask