Lets work in $\mathbb{R}^n$, and ignore extensions to manifolds for now. Let $\gamma:[0,1]\to \mathbb{R}^n$ be a curve in $\mathbb{R}^n$.
From classical physics, in the absence of a potential, the action $\mathcal{A}$ is the integral over time of the kinetic energy:
$$ \mathcal{A}(\gamma)=\int_0^1\frac{\|\dot{\gamma}(t)\|^2}{2} dt. $$
Minimising this action over 'admissible curves' starting at $\gamma(0)=x$ ending at $\gamma(1)=y$ we get
$$ c(x,y):=\frac{\|x-y\|^2}{2}=\inf\big\{ \mathcal{A}(\gamma),~\gamma(0)=x,~\gamma(1)=y,~"\gamma~\text{admissible}" \big\}.~~~~~~~~~(1) $$
The squared distance $\|x-y\|^2$ is used as the cost in the Wasserstein distance (an optimal transport problem).
I interpret this as the cost of a particle moving through Euclidean space at the absence of friction is determined just by the distance between the points.
If there is friction i.e a particle follows Newtons Equation \begin{align} \frac{d\gamma(t)}{dt}=&\dot{\gamma}(t)~~~~~~~~~(2) \nonumber \\ \frac{d\dot{\gamma}(t)}{dt}=&-\nabla V(\gamma(t)). \\ t\in[0,1],&~ \gamma_0=x,\gamma_1=y \end{align}
where $V:\mathbb{R}^n\to \mathbb{R}$ is some potential. The associated action (i.e $(2)$ is the Euler Lagrange equation : ) is
$$ \mathcal{A}(\gamma)=\int_0^1 \frac{\|\dot{\gamma}(t)\|^2}{2}-V(\gamma(t)) dt. $$
$\textbf{Can I associate a cost function to the above, like we have in equation $(1)$?}$, and how can I interpret this cost $c(x,y)$!?