The correct statement is: Both balls have equal potential energy.
Potential energy depends on the height of the objects above a reference point (usually ground level) and their mass. If both balls reach the same height at the top of the hill and have the same mass, they will have the same final potential energy, regardless of the path taken to get there.