It sounds that shorter λ (more energy) makes the wave more powerful to go through a specific thickness of the material, but the weaker wave does it better. How are the interactions of the wave with the molecules?
For the same reason that the dusk and dawn sky is red near the horizon and blue overhead. There’s an inverse 4th power of scattering intensity with wavelength meaning that the lower wavelengths are scattered out and the longer wavelengths reach the observer. Halve the wavelength and the scattering intensity is increased 16-fold.
It is true that transparent materials may have imperfections that result in sub wavelength fluctuations in the density and produce Rayleigh scattering. For example, this is an important component of the transmission range in optical fibers. True also for molecular scattering in the atmosphere.
However, if you are asking about the penetration depth into a homogenous material with some degree of absorption, absorption is NOT described by Rayleigh scattering. Instead, see
https://en.m.wikipedia.org/wiki/Penetration_depth
Absorption is the resonant interaction of the EM wave with some allowed energy transition of the charges in the material that has a transition dipole moment. Because this is a resonance phenomenon the strength of the interaction, i.e. the absorption probability, can have a lot of shape as a function of wavelength (energy). Near a discrete transition the absorption may increase as you shorten the wavelength and then decrease again as the energy increases further past the absorption. (Absorption bands). The absorption probability results in a Beer’s law exponential decay of the field. So you can see the penetration depth may decrease or increase with shorter wavelength depending which side of a discrete absorption you are on. However, there is also an intrinsic inverse dependence on wavelength. (See wiki article) if the absorption is almost constant with wavelength (and so the complex index is constant) as is common above the band gap energy of semiconductors or transparent materials, the intrinsic 1/lambda dependence becomes apparent.
Agree with you - in a completely homogeneous (or assumed homogeneous) system we need to look at Bouguer (Beer-Lambert) where there is the inverse dependence on wavelength and an exponential loss in radiation. As you say may systems are not perfect and imperfections will give rise to light loss through scattering rather than and in addition to absorption.
It’s not so much a question of homogeneity as it is whether we are talking about absorption or scattering. It isn’t clear from the question what we are talking about, but, just in case they are referring to absorption, I was pointing out absorption is not scattering.