Charge-localization effects in the infrared transmittance of layered perovskites