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.
Consider two reference frames $S$ and $S'$. Assume that $S'$ moves with a velocity $\mathbf{u}=u\mathbf{\hat{x}}$ relative to $S$ such that the origins of $S$ and $S'$ coincide at $t=0$ and their axes remain parallel. Further assume that the surface of the inclined plane is stationary in $S$ as shown in the figure (the dashed curve can be ignored till the end of the discussion).
There are two points to consider before proceeding further.
The fundamental relation for energy considerations is the
work-energy theorem which states that the change in the
kinetic energy of a particle as it moves from an initial
point $A$ to a final point $B$ is equal to the work done
$$K_B - K_A = \int_{t_A}^{t_B}
\mathbf{F}(t) \cdot \mathbf{v}(t) \, dt$$
where the force $\mathbf{F}(t)$ can arise from a constraint,
be time-dependent or be non-conservative. The work-energy
theorem is frame-independent. It is only in the special case of time-independent and conservative forces that one can identify a scalar potential energy $U$ such that $\mathbf{F} = - \nabla U$. Then the work energy theorem boils down to $K+U=\mathrm{constant}$.
The block is confined to move on the surface of the inclined plane of constant inclination $\theta$. In the frame $S$, this static (scleronomic) constraint can be expressed as
$$x \, \tan\theta + y - h=0.$$
In the frame $S'$, the surface of the inclined plane is non-stationary and this moving (rheonomic) constraint can be written as
$$x \, \tan\theta + y - H(t)=0$$
where $H(t)=h - u \tan\theta \,\, t$. Forces arising from scleronomic constraints do no work since they are orthogonal to the velocity. However forces arising from rheonomic constraints can perform real work since the net velocity of the particle can have a component along the direction of the constraint forces. See section 2.1 of Jose and Saletan for a beautiful discussion of this concept.
Newton's law in either frame is
$$m \dot{\mathbf{v}} = -mg {\hat{\mathbf{y}}} + \mathbf{F}_c(t)$$
where $\mathbf{F}_c$ is the force of constraint. As done in proving the work-energy theorem, we multiply by $\mathbf{v}$ and integrate with respect to time to get
$$K_B - K_A = mg \big[ y(t_A) - y(t_B) \big] + W_c$$
where the work done by the constraint forces is
$$W_c = \int_{t_A}^{t_B} \mathbf{F}_c(t) \cdot \mathbf{v}(t) \, dt \qquad \textrm{in }S$$
and
$$W_c' = \int_{t_A}^{t_B} \mathbf{F}_c'(t) \cdot \mathbf{v}'(t) \, dt \qquad \textrm{in }S'.$$
It is easily shown that
$$\mathbf{F}_c(t) = \mathbf{F}_c'(t) = mg \cos\theta \, (\sin\theta \mathbf{\hat{x}} + \cos\theta \mathbf{\hat{y}} ).$$
Also it is easy to show that the velocity $\mathbf{v}$ and the position $\mathbf{r}$ of the block in $S$ are
$$\mathbf{v} = g t \sin \theta \, (\cos\theta \mathbf{\hat{x}} - \sin\theta \mathbf{\hat{y}} )$$
$$\mathbf{r} = \frac{g t^2 \sin \theta \cos\theta}{2} \mathbf{\hat{x}} + \Big( h - \frac{g t^2 \sin^2 \theta}{2} \Big) \mathbf{\hat{y}}.$$
The corresponding quantities in $S'$ are obtained via the Galilean transformation
$$\mathbf{v}' = \mathbf{v} - \mathbf{u}$$
$$\mathbf{r}' = \mathbf{r} - \mathbf{u} t.$$
We find $\mathbf{F}_c \cdot \mathbf{v} = 0$ and hence $W_c=0$ while
$$W_c'= -\int_{t_A}^{t_B} \mathbf{F}_c(t) \cdot \mathbf{u} \, dt
= -mug \sin\theta\cos\theta (t_B-t_A).$$
Therefore the work-energy theorem in $S$ is
$$K_B - K_A = mg \big[ y(t_A) - y(t_B) \big]$$
while in $S'$ it takes the form
$$K_B' - K_A' = mg \big[ y'(t_A) - y'(t_B) \big] - mug \sin\theta\cos\theta (t_B-t_A).$$
We can now finally come to the particular problem asked by the OP. Take the points $A$ and $B$ to be respectively those points where the inclined surface meets the $y$ and $x$ axes. The time $T$ taken by the block to slide down the incline from a height $h$ is obtained from solving $y(T) = 0$ as
$$T = \frac{\sqrt{2h/g}}{\sin\theta}$$
and at this instant of time
$\mathbf{v}(T) = \sqrt{2gh} \, (\cos\theta \mathbf{\hat{x}} - \sin\theta \mathbf{\hat{y}} ).$
We now verify the work-energy theorem
in frame $S$
$$K_B-K_A=\frac{m}{2} \big[ v(T)^2 - v(0)^2] = mgh$$
while
$$mg \big[ y(t_A)-y(t_B) \big] = mgh$$
in frame $S'$
$$K_B'-K_A'=\frac{m}{2} \big[ v'(T)^2 - v'(0)^2] = \frac{mg^2T^2}{2} \sin^2\theta - mugT \sin\theta\cos\theta$$
while
$$
mg \big[ y'(t_A) - y'(t_B) \big] - mug \sin\theta\cos\theta (t_B-t_A)
= mgh-mugT \sin\theta\cos\theta
$$
which, using the relation between $h$ and $T$, is the same as $K_B'-K_A'$.
Thus the work-energy theorem is verified in both frames.
The OP asked for the particular case of $u=v_x(T)=\sqrt{2gh}\cos\theta=gT\sin\theta\cos\theta$ and considered energy conservation in $S'$. In this case
- $$K_B'-K_A'= \frac{mu^2}{2} (\sec^2\theta-2)$$
while
$$
mg \big[ y'(t_A) - y'(t_B) \big] - mug \sin\theta\cos\theta (t_B-t_A)
=\frac{mu^2}{2} (\sec^2\theta-2)
$$
Notice that $K_B' \neq 0$ -- this is because the $v_y(T)\neq 0$ as the OP implicitly assumed. The reason is that the OP was looking at the case where no motion in the vertical direction would be allowed when $y=0$, i.e., for $t>T$. However this would require that the constraint force (normal reaction) change discontinuously. A better solution would be to consider the block sliding down a smooth curve (such as the dashed curve in the figure). In this case $v_y(T)=0$ and the reaction force would also vary smoothly. The work-energy theorem would, ofcourse, still be valid.
NOTE:
The point that moving constraints can do real work was mentioned in the answer by Pygmalion.
This problem of a block sliding on a moving inclined plane is considered in section 3.9 of Strauch.
Worrying about the mass of the wedge or of the earth is misleading. We can just consider a particle constrained to move on a mathematical surface subject to a uniform and constant body force in the $y$-direction. This surface could also be moving. For this particular case, think of the beads sliding down a tilted abacus made of thin massless wires. You look at this situation from a frame at rest w.r.t. the abacus and then in a moving frame.
Best Answer
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.