The potential energy of the cart is,
where m is the mass, g is the acceleration due to gravity and h is the height of the cart,
As the value of mass and the value of acceleration due to gravity remain constant.
Thus, the maximum value potential energy is at the maximum height.
Hence, the cart will have the maximum potential energy at the top of the roller coaster.