Answer
Momentum is conserved when no external forces act on a system.
If the ball alone is our system, then momentum is not conserved when it rolls downhill.
We must consider the whole Earth and the rolling ball as our system. Then, the change of momentum of the ball is canceled by an equal and opposite change of momentum of the Earth. The system momentum is conserved.