Related to this question, I would like to prove a stronger statement for the case where we exclude $a_i$ from the question; an alternative way to view this is to set $a_i=1$ for all $i.$ Proposition:
If $x_i, y_i>0\ (*)\ \forall\ i\in\{1,\ldots,m\},$ and for each $j\in\{1,\ldots,m\},$
$$ \sum_{i=1}^m {x_i}^j = \sum_{i=1}^m {y_i}^j, $$
then $(x_i)^{m}_{i=1}$ is a rearrangement of $(y_i)^{m}_{i=1}.$
If so, can we relax condition $(*)$ to just: If $x_i, y_i\in\mathbb{R}\ \forall\ i\in\{1,\ldots,m\}\ ?$
The reason SagarM's proof in the body of his question won't work here is that his statement is for all integers $n$, and he argues that if the maximum of each set is different, then one side of the equation will dominate the other side for some large enough $n$. But in my question, there are only $m$ equations that are assumed true $(j\in\{1,\ldots,m\}),$ and so this domination argument doesn't work.
My attempt:
$m=1$ is trivial, since $x_1 = y_1\implies x_1 =y_1.$
$m=2:$ We have:
$${x_1}^2 + {x_2}^2 = {y_1}^2 + {y_2}^2 \quad (1), $$
$$ \text{and}\quad x_1 + x_2 = y_1 + y_2 \quad (2). $$
$$ \text{Thus,}\quad (2)^2-(1):\ x_1 x_2 = y_1 y_2 \quad (3) $$
$$ (1) - 2(3): (x_1-x_2)^2 = (y_1-y_2)^2 \implies x_1 - x_2 = \pm (y_1 - y_2)\quad (4) $$
$(4)$ together with $(2)$ yield the result.
However, I am stuck on $n=3$ and higher. I am interested in both algebraic methods, but also other ideas of course.
For every $k \in \lbrace 1, ..., m \rbrace$, let $P_k \in \mathbb{R}[X_1, ..., X_m]$ be the polynomial defined by $$P_k(X_1, ..., X_m) = X_1^k + ... X_m^k$$
The hypothesis in your statement is that for every $k \in \lbrace 1, ..., m \rbrace$, one has $$P_k(x_1, ..., x_n)=P_k(y_1, ..., y_m)$$
Applyting Newton's identities, you get that for every $k \in \lbrace 1, ..., m \rbrace$, $$e_k(x_1, ..., x_m) = e_k(y_1, ..., y_m)$$
where $e_k$ denotes the $k-$th elementary symmetric polynomial in $m$ variables. In particular, the polynomials $$(X-x_1)...(X-x_m) \quad \quad \text{and} \quad (X-y_1)...(X-y_m)$$
are equal, so they share the same roots, which is equivalent to say that the family $(x_i)_{1 \leq i \leq m}$ is a rearrangement of the family $(y_i)_{1 \leq i \leq m}$.