\ref{foo} uses (if defined) the control sequence \r@foo.
You can abstract the definition. I choose to do it at begin document, so when the .aux files have been read in.
\documentclass{article}
\usepackage{xr}
\usepackage{hyperref}
\externaldocument[A-]{external}
\ExplSyntaxOn
\NewDocumentCommand{\definelabelalias}{mm}
{
\AtBeginDocument
{
\cs_if_exist:cT {r@#2} { \cs_set_eq:cc {r@#1} {r@#2} }
}
}
\ExplSyntaxOff
\definelabelalias{foo}{A-test-external}
\definelabelalias{baz}{test-internal}
\begin{document}
\section{Test}\label{test-internal}
\ref{A-test-external} = \ref{foo}
\ref{baz} = \ref{test-internal}
\end{document}
The external file I used is
\documentclass{article}
\begin{document}
\section{Title}\label{test-external}
\end{document}
Note that you don't need xr-hyper. Everything produces 1 as expected and the links to the external labels have different colors than the internal.

If no .aux file is available (or isn't up-to-date) you get
LaTeX Warning: Reference `A-test-external' on page 1 undefined on input line 24.
LaTeX Warning: Reference `foo' on page 1 undefined on input line 24.
LaTeX Warning: Reference `baz' on page 1 undefined on input line 26.
LaTeX Warning: Reference `test-internal' on page 1 undefined on input line 26.
If the external .aux file is available, you just get
LaTeX Warning: Reference `baz' on page 1 undefined on input line 26.
LaTeX Warning: Reference `test-internal' on page 1 undefined on input line 26.
\ExpandArgs{cc}\let{r@newlabel}{r@oldlabel}