Your concept of 'mean distance' needs to be qualified.
I would suggest using the centroid of the convex hull of the separate communities.
That will be as good a representation as any other more complex solution which may in the end produce the same or very similar results.
Great lab question... since you have a DEM, this makes me think that Euclidean Distance would be too simple, but maybe Cost Distance or even Path Distance might be a choice... Food for thought... might use it in one of my classes
But again... do we deal with just closest point on the edge or the locations within the village... perhaps a question for the poser of the question since the concept of centrality still hasn't been addressed.
No... it means that there are many ways one can approach it... either simplistically... like using simple Euclidean solutions.... or one that address what the concept of 'shortest' or 'closest' actually means given the data that you have. Your answer depends on a clear definition of the assumptions being made. For example, you could assume that 'closest' could mean from the boundary of the communities, which means that travel distance from any location within the community is not relevant. In that case, one could simply determine the convex hull of both communities and then use the Near tool and you would have the shortest/closest distance between two polygons in vector world. You could perform a similar calculation using Euclidean distance (a raster solution).
As your assumptions begin to address the data provided, the concept of 'closest' becomes more important. Since you have a mountainous terrain separating the two, slope and the distance travelled along the slope comes into play. Travelling up and down hill along a straight line trajectory (ie Euclidean) may not be the shortest/closest since a path following flatter terrain that deviates from the straight line may prove to be the 'shortest' overall.
In summary, your answer is only as good as the assumptions that you make along the way. If you don't articulate those, then your answer may not agree with someone else's conclusions especially if they make assumptions about the question they posed. You must also think... the poser of the question may not have thought about some of these issues I have raised... I always ask myself .... 'is that the real question being asked?