Evolution of carrier and optical phonon distribution in photoexcited semiconductors