Given a curve $c :(\alpha,\beta)\to M$, its arc-length from $p$ to $q$ is given by $$\ell(c):=\int_\alpha^\beta\sqrt{g(c’(t),c’(t)}\, dt. $$ Since $\gamma$ is unit speed and minimises the length between $p$ and $q$, $$ \inf \{ \ell(c) \text{ s.t. } c\in C^1([0,b]; M), c(0)=p,c(b)=q\}= \ell(\gamma)=b.$$ Suppose that $\gamma \vert_{[\varepsilon,b]}$ does not minimise the length between $\gamma(\varepsilon)$ and $b$. Then there exists a competitor $\tilde \gamma \in C^1([\varepsilon,b];M)$ with $\tilde \gamma (\varepsilon)=\gamma(\varepsilon)$ and $\tilde \gamma(b) =q$ such that $\ell(\tilde \gamma)<\ell (\gamma \vert_{[\varepsilon,b]})$. Now define $$\bar \gamma (t) = \begin{cases}
\gamma(t), &\text{if } t\in [0,\varepsilon)\\
\tilde \gamma(t), &\text{if } t\in [\varepsilon,b].
\end{cases} $$ Formally, the arc-length from $p$ to $q$ of $\bar \gamma$ is \begin{align*}\ell (\bar \gamma) &= \int_0^\varepsilon\sqrt{g(\bar \gamma’(t),\bar \gamma’(t)}\, dt + \int_\varepsilon^b\sqrt{g(\bar \gamma’(t),\bar \gamma’(t)}\, dt \\
&< \int_0^\varepsilon\sqrt{g(\bar \gamma’(t),\bar \gamma’(t)}\, dt + \int_\varepsilon^b\sqrt{g(\tilde \gamma’(t),\tilde \gamma’(t)}\, dt \\
&=\ell(\gamma), \end{align*} which contradicts minimality of $\gamma$ from $p$ to $q$. The small technical issue I have with this argument is that $\bar \gamma$ may not longer by $C^1$, so is no longer admissible; however, taking a $C^1$ approximation, I would expect that you can fix this.