Boy, this was tricky, but the secret is in conservation of momentum.
See, you are assuming that, after the collision, the velocity of the ball-elevator ensemble is $u$, but this is not fully true: it will be $u' = u + \frac{m}{m+M}\sqrt{2gh}$, $M$ being the mass of the elevator. Of course if $M \to \infty$ that reduces to $u' = u$, but when computing the KE, something funny happens:
$$\frac{1}{2}(m+M)u'^2 = \frac{1}{2}(m+M)u^2 + \frac{m^2}{m+M}gh + um\sqrt{2gh}$$
That last term which does not depend on $M$ is the key here. Of course the first term, with the $(m+M)$ dominates the others, but it will be cancelled out by identical terms in the KE before the collision. But if you assume that because $M \to \infty$ you can take $u' = u$, you will be missing this last term, which exactly cancels out that extra energy.
Doing the math for a finite elevator mass, and using conservation of momentum to compute the final velocity, you eventually get to energy lost in an inellastic collision to be $\frac{1}{2}\frac{mM}{m+M}(u-v)^2$, which for $M \to \infty$ reduces to $\frac{1}{2}m(u-v)^2$, as Johannes already pointed out.
You have successfully discovered that the kinetic energy depends on the reference frame.
That is actually true. What is amazing, however, is that while the value of the energy is frame DEpendent, once you've chosen a reference frame, the law of conservation of energy itself is NOT reference frame-dependent -- every reference frame will observe a constant energy, even if the exact number they measure is different. So, when you balance your conservation of energy equation in the two frames, you'll find different numbers for the total energy, but you will also see that the energy before and after an elastic collision will be that same number.
So, let's derive the conservation of energy in two reference frames. I'm going to model an elastic collision between two particles. In the first reference frame, I am going to assume that the second particle is stationary, and we have:
$$\begin{align}
\frac{1}{2}m_{1}v_{i}^{2} + \frac{1}{2}m_{2}0^{2} &= \frac{1}{2}m_{1}v_{1}^{2} + \frac{1}{2}m_{2}v_{2}^{2}\\
m_{1}v_{i}^2 &= m_{1}v_{1}^{2} + m_{2}v_{2}^{2}
\end{align}$$
to save myself time and energy, I'm going to call $\frac{m_{2}}{m_{1}} = R$, and we have:
$$v_{i}^{2} = v_{1}^{2} + Rv_{2}^{2}$$
Now, what happens if we shift to a different reference frame, moving to the right with speed v? This is essentially the same thing as subtracting $v$ from all of these terms. We thus have:
$$\begin{align}
(v_{i}-v)^{2} + R(-v)^{2} &= (v_{1}-v)^{2} + R(v_{2}-v)^{2}\\
v_{i}^{2} -2v_{i}v + v^{2} + Rv^{2} &= v_{1}^{2} - 2 vv_{1} + v^{2} + Rv_{2}^{2}-2Rv_{2}v + Rv^{2}\\
v_{i}^{2} -2v_{i}v &= v_{1}^{2}- 2vv_{1} + Rv_{2}^{2}-2Rv_{2}v\\
v_{i}^{2} &= v_{1}^{2} + Rv_{2}^{2} + 2v(v_{i} - v_{1} - R v_{2})
\end{align}$$
So, what gives? It looks like the first equation, except we have this extra $2v(v_{i} - v_{1} - R v_{2})$ term? Well, remember that momentum has to be conserved too. In our first frame, we have the conservation of momentum equation (remember that the second particle has initial velocity zero:
$$\begin{align}
m_{1}v_{i} + m_{2}(0) &= m_{1}v_{1} + m_{2}v_{2}\\
v_{i} &= v_{1} + Rv_{2}\\
v_{i} - v_{1} - Rv_{2} &=0
\end{align}$$
And there you go! If momentum is conserved in our first frame, then apparently energy is conserved in all frames!
Best Answer
The first answer is correct. The second one is wrong because it ignores the energy of the heavy body.
In your example, imagine some putty hitting a wall. The putty is moving to the right and the wall is stationary. When there's a collision, the wall picks up some very tiny velocity $w$. That velocity is basically inversely-proportional to the wall's mass $M$. The kinetic energy it picks up is proportional to $Mw^2$, and thus also inversely proportional to $M$. Therefore, in this frame the wall's energy is negligible.
However, if there is a man moving to the left, he sees the putty moving faster, as you say, but he also sees the wall moving to the right. When the putty hits it, the wall will move a tiny bit faster to the right and pick up a little bit more kinetic energy. This time, though, the wall's energy gain cannot be made negligible by making the wall more massive. You can work out easily that in the limit $M\to\infty$ the kinetic energy the wall gains is $mvV$, compensating for that lost by the putty in this frame.
Here is a general solution. The kinetic energy of a particle is
$$T = \frac{\mathbf{p}^2}{2m}$$
If we boost into a frame moving at speed $\mathbf{v}$ relative to the original, the new momentum is
$$\overline{\mathbf{p}} = \mathbf{p} + m\mathbf{v}$$
the new kinetic energy works out to be
$$\overline{T} = T + \mathbf{p}\cdot\mathbf{v} + \frac{m\mathbf{v}^2}{2}$$
Thus the kinetic energy "added" by viewing the process in a new frame is
$$\Delta T = \mathbf{p}\cdot\mathbf{v} + \frac{m\mathbf{v}^2}{2}$$
If you have two particles, this becomes
$$\Delta T = (\mathbf{p_1 + \mathbf{p}_2})\cdot\mathbf{v} + \frac{(m_1 + m_2)\mathbf{v}^2}{2}$$
which is exactly the same as the expression for a single particle of momentum $\mathbf{p}_1 + \mathbf{p}_2$ and mass $m_1 + m_2$.
Say you are watching two particles. The energy is $E_1$. Before they collide, you boost to a new frame. In that new frame, the new kinetic energy is 100J greater, so the energy is $E_1 + 100J$. Then the particles collide. The energy becomes $E_2$.
You could also have waited for the particles to collide first, then boosted to a new frame. In that case, the energy after the collision and before the boost is $E_f$. What we showed above is that the boost still results in a gain of 100J, so the energy after the boost is $E_f + 100J$.
It is evident that $E_2 = E_f + 100J$ because they are the same physical situation. Therefore
$$E_2 - (E_1 + 100J) = E_f + 100J - (E_1 + 100J) = E_f - E_1$$
The left hand side is the energy lost during the collision in the boosted frame. The right hand side is the energy lost during the collision in the original frame. Thus, when there is an inelastic collision going on, boosting to a new frame only changes the total amount of kinetic energy around. It does not change the amount of kinetic energy transformed to thermal energy.