I need help with some details.
At first, we can consider $a\geqslant b$ WLOG.
Let $a^b=b^a.$ Notice that for $p$ prime we have $p\mid a \implies p\mid b$ and $p\mid b \implies p\mid a$. Therefore, by unique factorization, $a$ and $b$ have the same prime factors.
Thus, we can write
$$a=p_1^{\alpha_1}\cdots p_n^{\alpha_n} \text{ and } b=p_1^{\beta_1}\cdots p_n^{\beta_n}$$
$$\implies (p_1^{\alpha_1}\cdots p_n^{\alpha_n})^b=(p_1^{\beta_1}\cdots p_n^{\beta_n})^a$$
$$\implies \alpha_1b=\beta_1a,\ \ldots\ ,\alpha_ib=\beta_ia $$ So for every $i$ we have $\alpha_i=\frac{m}n\beta_i\,(m,n)=1$
Now we want to show $n=1$. $$\begin{aligned}a=b^{\frac{m}{n}}\\a^b=b^a\implies&{(b^\frac{m}n)}^b=b^{b^\frac{m}n}\\\implies&\frac{m}nb\ \ \ =b^\frac{m}n\\\implies &m^nb^n\ =n^nb^m\\\implies&{(\frac{m}n)}^n=b^{m-n}\end{aligned},$$ but right hand side is an integer so $n=1$ and $a=b^m$
$a^b=b^a \implies {(b^m)^b}=b^{(b^m)}\implies mb=b^m$ $$$$ if $m=b$ then $b^2=b^b\implies b=2,a=4$
$$$$ if $m<b$ then $m=b^{m-1}\Longrightarrow m=1, a=b$
But for $m>b$ I don't have any idea. Can you help me?
Hopefully this is not against the spirit of the question, as I think you're on the right track and others in the comments are helpful. I just wanted to elaborate on my comment that there is another way using calculus instead of FTA.
Let $f:[1,\infty)\to\mathbb{R}$, $f(x) = x^{1/x}$. We seek distinct integers $a,b$ such that $f(a)=f(b)$. Observe:
Now $f(2)=f(4)$, and this is the only solution! Indeed, by the Intermediate Value Theorem for $n\geq 5$, $f(n)=f(\alpha)$, for some $\alpha\in (1,2)$. But there are no integers between $1$ and $2$.