Let $a_1 \geq a_2 \geq \ldots a_n \geq 1$ and $r_1 \geq r_2 \geq \ldots r_n \geq 0$.
Then over all permutations $\pi$ of the $r_j$, the sum $\sum_{i=1}^{n}a_i^{r_{\pi_i}}$ is maximized when $r_i$ are in the same order as the $a_i$. The proof is similar to any standard proof of the original re-arrangment inequality.
For contradiction, suppose that some other permutation is larger. Then there exist terms $a^b$ and $c^d$ in the sum such that $a \geq c$ and $b \leq d$. But we have $a^d+c^b \geq a^b+c^d$, i.e. swapping these two exponents does not decrease the value of the sum.
To prove the inequality, re-write as $(a/c)^b \geq \dfrac{c^{d-b}-1}{a^{d-b}-1}$ and notice that the LHS is at least 1 and the RHS is at most 1.
Note: You need a weaker result and it may be sufficient to assume all the $a_i$s non-negative.