We can conclude that star A is closer to us than star B.
In fact, the absolute magnitude gives a measure of the brightness of the star, if all the stars are placed at the same distance from Earth. So, it's a measure of the absolute luminosity of the star, indipendently from its distance from us: since the two stars have same absolute magnitude, it means that if they were at same distance from Earth, they would appear with same luminosity. Instead, we see star A brighter than star B, and the only explanation is that star A is closer to Earth than star B (the closer the star A, the brigther it is)
        
             
        
        
        
We have: Gravitational Potential Energy (U) = mgh
Here, m = 3 Kg
g = 9.8 m/s²        [ constant value for earth system ]
h = 3 m
Substitute their values into the expression:
U = 3 × 9.8 × 3
U = 88.2 J
In short, Your Answer would be 88.2 Joules