Dynamics of fast and slow magnetoacoustic waves in plasma slabs with thermal misbalance