(1) for simplicity, let the masses start their motion from rest at the same position ... mark this initial position as the zero for GPE.
total mechanical energy of the system = 0
after release, large mass falls a distance x ... its energy is
small mass rises the same distance x ... its energy is
sum of both energies = 0