Let $p \neq \ell$ be distinct prime numbers, $G$ be a $p$-adic Lie group and $H$ be an $\ell$-adic Lie group. Let $f: G \to H$ is a continuous group morphism. We show that $f$ is locally constant.
Since $f$ is a group morphism, it is sufficient to show that there is an open neighbourhood $U$ of $1_G$ such that $f$ is constant on $U$.
In general, a $p$-adic Lie group is Hausdorff (by definition) and locally compact (since $\Bbb Q_p$ is), and has an open neighbourhood of the identity which is a pro-$p$-group
(see corollary 8.33 in Analytic Pro-P Groups $^{[1]}$), i.e. for every open normal subgroup $N\triangleleft G$, the quotient $G/N$ is a (finite) $p$-group.
Let $W \subset H$ be an open neighbourhood of $1_H$ which is a pro-$\ell$-group, and $V \subset G$ be an open neighbourhood of $1_G$ which is a pro-$p$-group
Let $U = f^{-1}(W) \cap V$, which is an open (hence closed) subgroup of $V$.
A closed subgroup of a pro-$p$-group is a pro-$p$-group (prop. 2.2.1 a) in Ribes, Zalesskii, Profinite groups). Hence $U$ is a pro-$p$-group, which maps via $f$ to the pro-$\ell$-group $W$, that is $f(U) \subset W$.
Thereby, we may assume that
$f: G \to H$ is a continuous morphism from a pro-$p$-group to a pro-$\ell$-group. We wish to show that $f(G) = \{1_H\}$, i.e. $f$ is constant.
In that setting, $f(G)$ is a compact subspace of the Hausdorff space $H$, hence closed. But a closed subgroup of a pro-$\ell$-group is a pro-$\ell$-group. Also, $f(G)$ is a pro-$p$-group.
Finally, notice that if $f(G)$ is both pro-$p$ and pro-$\ell$, then every open normal subgroup $N \leq f(G)$ has quotient being both a finite $p$-group and an $\ell$-group, which implies $f(G) / N = \{1\}$.
But the identity element of $f(G)$ admits a fundamental system of open normal subgroups, which are all equal to $f(G)$ as we just saw above. Then the topology on $f(G)$ is trivial, and also Hausdorff, hence $f(G)$ is a singleton. This finishes the proof.
$^{[1]}$ I'm not sure that this is an easy result. The main steps seems to be theorem 8.29 on the one hand: every $p$-adic analytic group has an open subgroup which is a "standard group", which is locally homeomorphic to $p\Bbb Z_p^r$ for some $r \geq 0$ (see definition 8.22), and theorem 8.31 on the other hand.