We can break down the problem as follows:
First, if you have two points on a plane and feed the coordinates of those points to a neural network (e.g., a vector $< x_0, y_0, x_1, y_1 >$) and and train it on a label thats the actual distance (e.g., $ \sqrt{(x_0 - y_0)^2 + (x_1-y_1)^2} $), it should be able to learn this relationship with arbitrarily close accuracy.
Next, if you have an image similar to what you describe, and feed that through a different neural network (e.g., a CNN), and as labels you used the the points of the two dots (once again $< x_0, y_0, x_1, y_1 >$), then it should be able to learn that relationship with arbitrarily close accuracy once again.
Of course, there's no reason to do this in two separate neural network, so we can just combine the two end-to-end have a model that takes the image as input and the distance as output.
This model would need to be trained on labeled data, however, so you'd either need to generate the data yourself or label images.
But if you wanted it to learn the notion of closing a distance in a less supervised way, you'd need to use reinforcement learning. In this case, you'd have to setup an environment that incentivises the agent to reduce the distance. This could be as simple as gaining reward if an action reduces the distance.
Another approach would be to incentivise the agent using future reward. That is, it's reward doesn't just come from the results of the next immediet state, but there's also contributions from the next possible state, and the one after that, and so on. This is the idea behind Deep Q-Learning, and I implement a simple example (very similar to what you're describing) in this notebook.
So, now the question is: has this implementation done something other than randomly moving around until it follows a path to success?
In your example, you talk about rewarding the agent when it lands on the goal. But in what I described, it gained reward by moving closer to the goal (either through the Q-Function or directly from the environment). It is able to do so by learning some abstract idea of distance (which can be illustrated in the supervised version).
When a human learns this, it's for the same exact reason: the human is gaining a reward for moving in that direction through a sense of future rewards.
I'd say that, given enough training and data, reinforcement learning could learn this concept with ease. As far as other rewards being present on the board (e.g., "minimise the entropy of the board as well as try to get rewards"), you need to think about what it is you're asking. Would you rather the agent minimize distance or maximize reward? Cause, in general, it can't do both. If you're looking for some balance between the two, then really you're just redefining the reward to also consider the distance.