[step:Reduce the assertion to a compact convex subset of $[0,1]^n$]
Fix $x = (x_1,\dots,x_n) \in X$ and $A \subset X$. If $A=\varnothing$, then $U_A(x)=\varnothing$, hence $\operatorname{conv}U_A(x)=\varnothing$ and
\begin{align*}
d_T(x,A)=\inf \varnothing=+\infty.
\end{align*}
For every $\alpha \in [0,\infty)^n$ with $|\alpha|\le 1$, the set over which the inner infimum is taken is empty, so
\begin{align*}
\inf_{y\in \varnothing}\sum_{i=1}^n \alpha_i\mathbb{1}_{\{x_i\ne y_i\}}=+\infty.
\end{align*}
The supremum of the constant value $+\infty$ is $+\infty$, and the identity follows.
Assume from now on that $A\ne\varnothing$. Define
\begin{align*}
S := U_A(x)=\{m_x(y):y\in A\}\subset \{0,1\}^n
\end{align*}
and define
\begin{align*}
C := \operatorname{conv}S \subset \mathbb{R}^n.
\end{align*}
Since $\{0,1\}^n$ is finite, $S$ is finite and nonempty. Therefore $C$ is a nonempty compact convex subset of $\mathbb{R}^n$, and $C\subset [0,1]^n$. By definition,
\begin{align*}
d_T(x,A)=\inf_{u\in C}|u|.
\end{align*}
For every $\alpha \in [0,\infty)^n$, linearity gives
\begin{align*}
\inf_{y\in A}\sum_{i=1}^n \alpha_i\mathbb{1}_{\{x_i\ne y_i\}}=\inf_{s\in S}\alpha\cdot s.
\end{align*}
Because the map $u\mapsto \alpha\cdot u$ is affine on $C=\operatorname{conv}S$, its infimum over $C$ equals its infimum over the finite set $S$. Hence the desired formula is equivalent to
\begin{align*}
\inf_{u\in C}|u|=\sup\{\inf_{u\in C}\alpha\cdot u:\alpha\in[0,\infty)^n,\ |\alpha|\le 1\}.
\end{align*}
[/step]