Despite the weird geometry of the problem, this is simply two masses connected by a spring, and we can solve that problem using Lagrangian Mechanics. Let's assume that the masses have mass $M$ and m, and position coordinates $x_M$ and $x_m$ respectivly. They are also separated by a distance $d$, and the spring constant is $k$.
We will use $\alpha$ as the generalized coordinate representing how far the masses have stretched from equilibrium:
$$
\alpha = x_M - x_m - d
$$
Note also that
$$
\dot{\alpha} = \dot{x}_M - \dot{x}_m,
$$
because $d$ is a constant, and we can choose a frame in which the total momentum of the system is zero, which gives us
$$
m \dot{x}_m = -M \dot{x}_M
$$
We can write the kinetic energy as
$$
T = \frac{1}{2} m \dot{x}_m^2 + \frac{1}{2} M \dot{x}_M^2,
$$
and then transform to our generalized coordinate $\alpha$ using the above two equations:
$$
T = \frac{1}{2} m \dot{x}_m^2 + \frac{1}{2} M \Big(\dot{x}_m \frac{m}{M}\Big)^2
$$
$$
T = \frac{1}{2} m \Big( -\dot{\alpha} \frac{M}{m+M}\Big)^2 + \frac{1}{2} M \Big( \Big( -\dot{\alpha} \frac{M}{m+M}\Big) \frac{m}{M}\Big)^2
$$
$$
T= \frac{1}{2} \frac{m M^2}{(m+M)^2} \dot{\alpha}^2+ \frac{1}{2} \frac{m^2 M}{(m+M)^2}\dot{\alpha}^2
$$
$$
T= \frac{1}{2} \frac{m M}{m+M} \dot{\alpha}^2
$$
$$
T= \frac{1}{2} \mu \dot{\alpha}^2,
$$
where $\mu$ is the reduced mass.
The potential energy is much easier to find:
$$
U = \frac{1}{2} k \alpha^2.
$$
Our Lagrangian then is
$$
L = T-U
$$
$$
L = \frac{1}{2}\mu \dot{\alpha}^2 - \frac{1}{2} k \alpha^2,
$$
which can be plugged into the Euler-Lagrange equation
$$
\frac{d}{dt} \frac{\partial L}{\partial \dot{\alpha}} - \frac{\partial L}{\partial \alpha}=0.
$$
This equation is easy to solve by hand:
$$
\mu \ddot{\alpha}+k \alpha = 0.
$$
This is clearly the equation for a simple harmonic oscillator with angular frequency $\sqrt{k/\mu}$, which is the answer you were looking for!