Let $f:\mathbb{R^2}\to \mathbb{R}_+$ be a continuous function, and let
$$ \mathrm{dist}_f(p,q):= \inf\left\{\int_\gamma f(x)\,\mathrm{d}x \,:\, \gamma \text{ is a $C^1([0,1]; \mathbb{R}^2)$ curve with } \gamma(0)=p,\, \gamma(1)=q\right\}. $$
This one is a distance. Assume that for every choice of $p$ and $q$ such a distance is realized by the straight segment. Is it then true that (up to a multiplicative constant $L$) this distance is exactly the Euclidean one $\|p-q\|$, or, equivalently that the function we started with is constant ($f\equiv L$)?
If I knew in advance that my metric space $(\mathbb{R}^2, \mathrm{dist}_f)$ is actually a Riemannian manifold $(\mathbb{R}^2, g)$ whose metric tensor $g$ induces the distance $\mathrm{dist}_f$, then it is my understanding that the answer is positive by using the Christoffel symbols (refer to All straight curves are geodesics imply Euclidean metric).
ADDED: basically I'm replacing the knowledge of the distance being induced by a Riemannian tensor with the fact that it can be written as an integral. For a general distance $\mathrm{dist}(\cdot)$ the claim would be false on $(\mathbb{R}^2; \mathrm{dist}(\cdot))$, it is enough to consider the $L^\infty$ norm.