Let me define
$$\tilde B = B = \{ u \in H^{1,p}_{0} (B(x_0 , 2r)) \cap C (B(x_0 , 2r)) : u=1 \ on \ K\}.$$
Then by Stampacchia's lemma,
it is easy to see that the $\inf$ over $\tilde B$ equals the $\inf$ over $B$. Since $A \subset \tilde B$, it remains to show $\inf_A \le \inf_{\tilde B}$.
Therefore, the idea is to take $f \in \tilde B$ and approximate it with $g_\varepsilon \in A$, such that
$$\int |\nabla f|^p dx +\varepsilon \ge \int |\nabla g_\varepsilon|^p dx.$$
This shows
$$\inf_{\tilde B}(\ldots) + \varepsilon \ge \inf_{A}(\ldots).$$
Since this holds for all $\varepsilon > 0$, we have
$$\inf_{\tilde B}(\ldots) \ge \inf_{A}(\ldots).$$
It remains to give an idea for the approximation of $f \in \tilde B$ with $g_\varepsilon \in A$. Since your functional is continuous w.r.t. the norm in $H^{1,p}$, we just need to ensure that we can construct a $g_\varepsilon$ with
$$\| f - g_\varepsilon\|_{1,p} \le \varepsilon$$
for all $\varepsilon > 0$.
Therefore, take $\delta > 1$ and observe that $\delta \, f \ge \delta$ on $K$. Hence, the set $X = \{x : \delta \, f(x) \ge 1\}$ is a neighbourhood of $K$. Now, convolve $\delta\,f$ with a smooth kernel $\varphi$ (which is close to the dirac delta). This yields a smooth function $g = \varphi \star \delta \, f$. Since $\delta\,f \ge 1$ on $X$ and since $\varphi$ has small support and $\int \varphi = 1$, we get $g \ge 1$ on a neighbourhood of $K$. Finally, you get
$$\|f - g\|_{1,p} \to 0$$
as $\delta \to 1$ and $\varphi$ approaches the dirac delta.