Modeling CO, CO2, and H2O Ice Abundances in the Envelopes of Young Stellar Objects in the Magellanic Clouds