Answer
$-0.2\;\rm m/s,\;1.4\;m/s$
Work Step by Step
Let's assume that the two carts are moving without friction and that the spring is massless and obeying Hooke's law; which means that the system [the two carts+the spring] is an isolated system.
So the momentum and energy of the system are conserved.
$$p_{ix}=p_{fx}$$
where $p_{ix}$ is before the string being cut, end $p_{fx}$ is after cutting the string.
$$(m_1+m_2)v_i=m_1v_1+m_2v_2$$
Plugging the known;
$$(0.1+0.3)\times 1=0.1v_1+0.3v_2$$
$$0.4=0.1v_1+0.3v_2$$
Multiplying both sides by 10;
$$4= v_1+3v_2$$
Thus,
$$v_1=4-3v_2\tag 1$$
$$E_i=E_f$$
$$K_i+U_{is}=K_f+U_{fs}$$
The massless spring finally is set free with no compression and no stretching.
$$ \frac{1}{2}(m_1+m_2)v_i^2+ \frac{1}{2}kx_i^2= \frac{1}{2} m_1v_1^2+ \frac{1}{2} m_2 v_2^2+\frac{1}{2}k(0)^2$$
$$\color{red}{\bf\not}\frac{1}{2}(m_1+m_2)v_i^2+\color{red}{\bf\not}\frac{1}{2}kx_i^2=\color{red}{\bf\not}\frac{1}{2} m_1v_1^2+\color{red}{\bf\not}\frac{1}{2} m_2 v_2^2 $$
Plugging the known;
$$ (0.1+0.3)(1)^2+120(0.04)^2= 0.1v_1^2+ 0.3 v_2^2 $$
$$0.592= 0.1v_1^2+ 0.3 v_2^2 $$
Multiplying both sides by 10;
$$5.92= v_1^2+ 3 v_2^2 $$
Plugging from (1);
$$5.92= (4-3v_2)^2+ 3 v_2^2 $$
$$5.92= 16-24v_2+9v_2^2 + 3 v_2^2 $$
Thus,
$$ 12 v_2^2 -24v_2+10.08=0$$
Therefore,
$v_{2}=0.6\;\rm m/s$ or, $v_{2}=1.4\;\rm m/s$
Hence, plugging these into (1);
$v_{1}=2.2\;\rm m/s$ or, $v_{2}=-0.2\;\rm m/s$
Now we have two results and we do not know which one is the right one.
1- If $v_1=2.2\;\rm m/s$, then $v_{2}=0.6\;\rm m/s$
2- If $v_1=-0.2\;\rm m/s$, then $v_{2}=1.4\;\rm m/s$
Let's discuss this situation, we know that when the string is cut, the spring will push $m_2$ forward while pushing $m_1$ backward at the same time.
This means that the velocity of cart 2 must be increased to be greater than the initial speed of the system of 1 m/s and hence the velocity of cart 1 must be decreased to be less than the initial speed.
This means that the second result is the right answer since cart 2's velocity increases and cart 1 velocity decreases to a limit that makes it moves in the opposite direction.
From all the above;
$$v_1=\color{red}{\bf -0.2}\;\rm m/s$$
$$v_2=\color{red}{\bf 1.4}\;\rm m/s$$