1. He saw some horses on the farm.

2. He was on the farm and saw some horses there.
3. He was not on the farm. He was a little far away from the farm. He was able to see some horses which are on the farm.
--------------------------------------
Does #1 mean #2 or #3?
If 'on the farm' is an adverbial phrase, #1 mean #2. If 'on the farm' is an adjective phrase, #1 is #3. Is that right?

No, 1 and 2 mean the same thing.

If you want 1 to mean something close to 3, then you need to add something to 1 that indicates he was elsewhere, but still in sight of the farm. Maybe this ...

From a hill across the valley, he saw some horses on the farm.