Without any metric: an ant living flat on a torus may exhibit a complete planar graph of five vertices ($K_5$). The it knows it does not live in a sphere. In fact the vertex chromatic number of the torus is 7. It works for n hole torus.
REMARK: It is not clear that living flat on the sphere you can show that $K_5$ is not planar. Meaning in general that differentiating a surface of type $A$ from a surface $B$ may not be symetrical.