If "ball" size is comparable to "pixel" size then you can just take 4 pixels surrounding ball and calculate gradients from them.
For example:
dx = Height(x-1) - Height (x+1)
dy = Height(y-1) - Height (y+1)
Now vector N = (dx, dy) gives you something like normal to surface. From this point you can use this normal to calculate "surface reaction" force Freaction = N * (N dotproduct Fgravity)

But except surface reactiion force you also [possibly] have friction force which will stop your ball with time at local suface minimum.

After applying above mentioned forces over time your ball will have kinetic energy (speed*mass ?) while it's moving - so it will be able to roll over small hills.
------
These are the basics - you should check them and probably correct at some points.