There are externalities that are increasing the cost of 'land' farming, among them water availability, GMO concerns, pest control, and land/labor costs. At some point robot harvested, hydroponically grown, vegetables will cap the cost of producing food that way. And if the 'old fashioned' way will become more expensive than that.
The key difference in cost between the two is, as you point out, the cost of energy. Using 'free' solar power versus using grow lights, changes the equation fairly dramatically. But one of the possible futures is that humans will master the ability to harvest more abundant energy. In so doing, I believe humans will have changed the economics of hydroponics dramatically, and things like pest control and labor cost advantages will swing over to the hydroponics side.