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:
2kg*9.81(g)*10m = 196.2J
The second ball has more potential energy