Gravitational U = -Gm1m2/r, thus the distance (r) the two carts are apart affects how much U you end up with, no? Thus it also affects whether or no ME is ultimately conserved, because you can just set the distance so that it is. Can you even freely set the distance/ where h=0 is, even though it is not an earth-object system? So because of such variation, I feel like distance does matter in these cases, and you need to be given the distance between the objects to answer the question.
Consider the time interval from when the two carts are released until just after they collide. For the system consisting of only the two carts, indicate whether the total mechanical energy increases, decreases, or remains the same. (The carts start out at rest btw)