Each ball gets the same energy because of Hooke's Law, which states that the force (F) applied by a spring is proportional to the distance (x) it is compressed.
That is, F = kx.
The proportionality constant (k) is specific to a given spring.
If we can assume that each spring is identical, then each spring has the same k. If we compress the springs by the same amount x, each ball will receive the same force kx.
The potential energy of each ball at this point is given by E = ½kx2. Note that this energy is not a function of mass.
One cannot demonstrate time-of-flight mass spectrometry by rolling balls down a ramp -- substituting gravity for the springs -- since in the gravitational case the potential energy (mgh, where g is the gravitational constant and h is the height) is a function of mass.