[guided]Because $q$ may lie in the cut locus of $p$, the original distance function $r_p$ may fail to be smooth at $q$, so it cannot necessarily be inserted directly into the Laplacian. The barrier method replaces $r_p$ near $q$ by a smooth function that sits above it and agrees with it at $q$.
Let
\begin{align*}
L := r_p(q)=d_g(p,q).
\end{align*}
Completeness of $(M,g)$ allows us to use the Hopf-Rinow theorem: there exists a unit-speed minimizing geodesic
\begin{align*}
\gamma: [0,L] &\to M
\end{align*}
with $\gamma(0)=p$ and $\gamma(L)=q$. Choose $0<\delta<L$ with $L-\delta \in I_k$, and define
\begin{align*}
p_\delta := \gamma(\delta).
\end{align*}
The point $p_\delta$ is obtained by moving the base point slightly forward along the chosen minimizing geodesic. Calabi's regularity lemma says that, for such a shifted base point, the distance function $d_g(p_\delta,\cdot)$ is smooth in some neighbourhood $U_\delta$ of $q$. Therefore the function
\begin{align*}
r_\delta: U_\delta &\to \mathbb{R}\\
x &\mapsto \delta+d_g(p_\delta,x)
\end{align*}
is a $C^2$ function near $q$.
We now verify that this smooth function is an upper support for $r_p$. For every $x \in M$, the triangle inequality gives
\begin{align*}
d_g(p,x) \leq d_g(p,p_\delta)+d_g(p_\delta,x).
\end{align*}
Since $\gamma$ is unit-speed and $p_\delta=\gamma(\delta)$, we have
\begin{align*}
d_g(p,p_\delta)=\delta.
\end{align*}
Hence
\begin{align*}
r_p(x)=d_g(p,x) \leq \delta+d_g(p_\delta,x)=r_\delta(x).
\end{align*}
At the point $q$, the subsegment $\gamma|_{[\delta,L]}$ is still minimizing, so
\begin{align*}
d_g(p_\delta,q)=L-\delta.
\end{align*}
Thus
\begin{align*}
r_\delta(q)=\delta+d_g(p_\delta,q)=\delta+(L-\delta)=L=r_p(q).
\end{align*}
So $r_\delta$ lies above $r_p$ and touches it exactly at $q$, which is precisely the geometric requirement for an upper barrier.[/guided]