Longitudinal and transverse responses in quasielastic electron scattering from Pb-208 and He-4