Kinetic energy = 0.5*M*V^2 

0.5*3*(2^2)= 6J


0.5*2*(2^2)= 4J
the second ball has more kinetic energy.


at the max height, all the kinetic energy is converted to potential energy, 

gravitational potential energy is = M*g*h

that theory would apply if you wanted to work out the maximum height achieved if the balls were thrown upward by rearranging. But, we are simply working out which ball will have more potential energy so:

First ball:
2kg*9.81(g)*10m = 196.2J

Second ball
4kg*9.81*10m= 392.4J

The second ball has more potential energy