The population dynamics of a two-atom system, which is in two independent Lorentzian reservoirs or in two independent Ohmic reservoirs respectively, where the reservoirs are at zero temperature or finite temperature, is studied by using the time-convolutionless master-equation method. The influences of the characteristics and temperature of a non-Markovian environment on the population of the excited atoms are analyzed. We find that the population trapping of the excited atoms is related to the characteristics and the temperature of the non-Markovian environment. The results show that, at zero temperature, the two atoms can be effectively trapped in the excited state both in the Lorentzian reservoirs and in the Ohmic reservoirs. At finite temperature, the population of the excited atoms will quickly decay to a nonzero value.