Solution (source code)

= Solution

For a <sphere> with uniform <mass density>, $M=(4\pi/3)\rho a^3$. Its <moment of inertia of a uniform solid sphere> is $I=2Ma^2/5$, and rotation about a diameter gives <angular momentum> magnitude $L=I\omega$. The spheres have the same <angular frequency> $\omega$, so
$$
\frac{M_A}{M_B}=\frac{\rho_A}{\rho_B}\left(\frac{a_A}{a_B}\right)^3=\frac14\,2^3=2,
\qquad
\boxed{\frac{L_A}{L_B}=\frac{I_A}{I_B}=\frac{M_A}{M_B}\left(\frac{a_A}{a_B}\right)^2=8.}
$$
The <mass> grows by a factor of two, and the extra squared lever arm supplies a further factor of four. Equal <angular frequencies> alone do not mean equal <angular momenta>.