Suppose we simply your system to a cart carrying a single large grain of sand, and we drop this grain of sand off the cart at some height $h$.
We only drop the sand grain, we don't throw it, so we do no work on the sand grain and the sand grain does no work on us. That means the kinetic energy and momentum of the cart is unaffected by the sand grain. So the trajectory of the cart is unaffected by the fact we dropped the grain of sand off it. Of course, the same applies to the grain of sand: its trajectory is unaffected by the fact it's been dropped off the cart. Both the cart and sand grain carry on sliding along the ramp and they will both rise to the same height on the far side of the ramp.
The same argument applies if you drop two grains of sand, three grains of sand and indeed $n$ grains of sand for any value of $n$. In all cases the cart will reach the other extreme edge of the ramp (where it will stop then start sliding back and eventually reach its starting point).