This is due to low frequency sound waves. The movement of the heavy truck produces sound waves into the ground. These sound waves have low frequencies, meaning they have very long wavelengths. Low frequency sound waves aren't heard by humans so much as felt. So these waves travel through the ground and ultimately to a house. The window sashes have enough room for motion in them that they move as a result of the waves and produce a rattling sound. The same type thing can happen with a powerful subwoofer from a sound system. Subwoofers produce these same types of sound waves.