I think a more fundamental way to approach the problem is by discussing geodesic curves on the surface you call home. Remember that the geodesic equation, while equivalent to the Euler-Lagrange equation, can be derived simply by considering differentials, not extremes of integrals. The geodesic equation emerges exactly by finding the acceleration, and hence force by Newton's laws, in generalized coordinates.
See the Schaum's guide Lagrangian Dynamics by Dare A. Wells Ch. 3, or Vector and Tensor Analysis by Borisenko and Tarapov problem 10 on P. 181
So, by setting the force equal to zero, one finds that the path is the solution to the geodesic equation. So, if we define a straight line to be the one that a particle takes when no forces are on it, or better yet that an object with no forces on it takes the quickest, and hence shortest route between two points, then walla, the shortest distance between two points is the geodesic; in Euclidean space, a straight line as we know it.
In fact, on P. 51 Borisenko and Tarapov show that if the force is everywhere tangent to the curve of travel, then the particle will travel in a straight line as well. Again, even if there is a force on it, as long as the force does not have a component perpendicular to the path, a particle will travel in a straight line between two points.
Also, as far as intuition goes, this is also the path of least work.
So, if you agree with the definition of a derivative in a given metric, then you can find the geodesic curves between points. If you define derivatives differently, and hence coordinate transformations differently, then it's a whole other story.
Minimize for $t$
$$d^2(t)=(at^2-p)^2+(2at)^2.$$
$$(d^2(t))'=2(at^2-p)2at+2(2at)2a=0.$$
Then
$$t=0\lor\left(p\ge2a\land at^2=p-2a\right),$$
The first case gives
$$d^2=p^2,$$
and the second
$$d^2=4a(p-a).$$
Take the smallest of the two.
Best Answer
The same maximal distance occurs in each quadrant, so we can restrict attention to $t\in[0,\pi/2]$. The tangent vector at $t$ is $(-a\sin t,b\cos t)$. This vector is normal to the line, so we just have to take the scalar product of a unit vector in this direction with the position vector in order to find the distance of the origin from the line:
$$ \begin{eqnarray} D &=& \left\lvert\frac{(-a\sin t,b\cos t)}{\sqrt{a^2\sin^2t+b^2\cos^2t}}\cdot(a\cos t,b\sin t)\right\rvert \\ &=& \frac{(a^2-b^2)\sin t\cos t}{\sqrt{a^2\sin^2t+b^2\cos^2t}}\;. \end{eqnarray}$$
Differentiating with respect to $t$ yields
$$\frac{a^2\sin^4 t-b^2\cos^4t}{\left(a^2\sin^2t+b^2\cos^2t\right)^{3/2}}\;,$$
and setting this to zero yields
$$a^2\sin^4t=b^2\cos^4t\;,$$
$$t=\arctan\sqrt{\frac ba}\;.$$
Using $\cos t=1/\sqrt{1+\tan^2 t}$, we can evaluate $D$ at this parameter:
$$ \begin{eqnarray} D &=& \frac{(a^2-b^2)\sin t\cos t}{\sqrt{a^2\sin^2t+b^2\cos^2t}} \\ &=& \frac{(a^2-b^2)\tan t}{\sqrt{a^2\tan^2t+b^2}}\cos t \\ &=& \frac{(a^2-b^2)\tan t}{\sqrt{a^2\tan^2t+b^2}}\frac1{\sqrt{1+\tan^2 t}} \\ &=& \frac{(a^2-b^2)\sqrt{b/a}}{\sqrt{a^2(b/a)+b^2}}\frac1{\sqrt{1+b/a}} \\ &=& \frac{a^2-b^2}{a+b}\;. \\ &=& a-b\;. \end{eqnarray}$$
The result obviously supports your idea that there might be a simpler way to do this.