Let's try a more detailed description, but similar to Hagen's answer (as it is the most straightforward approach).
$$
\mathrm{d}(\overline{A},\overline{B})=\inf\{\mathrm{d}(a,b):a\in\overline{A},b\in\overline{B}\}\tag{1}
$$
and
$$
\mathrm{d}(A,B)=\inf\{\mathrm{d}(a,b):a\in A,b\in B\}\tag{2}
$$
Since $A\subset\overline{A}$ and $B\subset\overline{B}$, $\mathrm{d}(\overline{A},\overline{B})$ is the infimum over a larger set than $\mathrm{d}(A,B)$. Therefore,
$$
\mathrm{d}(\overline{A},\overline{B})\le\mathrm{d}(A,B)\tag{3}
$$
Now, suppose that for $\epsilon\gt0$,
$$
\mathrm{d}(A,B)=\mathrm{d}(\overline{A},\overline{B})+\epsilon\tag{4}
$$
that is, the inequality in $(3)$ is strict.
Definition $(1)$ says that we can find an $\overline{a}\in\overline{A}$ and a $\overline{b}\in\overline{B}$ so that
$$
\mathrm{d}(\overline{a},\overline{b})\lt\mathrm{d}(\overline{A},\overline{B})+\frac\epsilon3\tag{5}
$$
By the definition of closure, we can find $a\in A$ so that
$$
\mathrm{d}(a,\overline{a})\lt\frac\epsilon3\tag{6}
$$
and $b\in B$ so that
$$
\mathrm{d}(b,\overline{b})\lt\frac\epsilon3\tag{7}
$$
By $(5)$, $(6)$, $(7)$, and the triangle inequality, we get
$$
\begin{align}
\mathrm{d}(a,b)
&\le\mathrm{d}(a,\overline{a})+\mathrm{d}(\overline{a},\overline{b})+\mathrm{d}(b,\overline{b})\\[3pt]
&\lt\frac\epsilon3+\mathrm{d}(\overline{A},\overline{B})+\frac\epsilon3+\frac\epsilon3\\
&=\mathrm{d}(\overline{A},\overline{B})+\epsilon\tag{8}
\end{align}
$$
But by $(2)$
$$
\begin{align}
\mathrm{d}(A,B)
&\le\mathrm{d}(a,b)\\
&\lt\mathrm{d}(\overline{A},\overline{B})+\epsilon
\end{align}\tag{9}
$$
which contradicts $(4)$. Therefore,
$$
\mathrm{d}(\overline{A},\overline{B})=\mathrm{d}(A,B)\tag{10}
$$