Decomposition of a representation into a direct sum of irreducible ones
Solution 1:
I think this may be easier to understand if you change the notation a bit. Instead of grouping the direct summands by their isomorphism type, just list them all without grouping. So we have two decompositions $V=\bigoplus S_m$ and $W=\bigoplus T_n$, where each $S_m$ and each $T_n$ is irreducible. Given an isomorphism $\varphi:V\to W$, let $\varphi_{mn}:S_m\to T_n$ be the composition of $\varphi$ with the inclusion $S_m\to V$ and the projection $W\to T_n$. By Schur's lemma, each $\varphi_{mn}$ is either an isomorphism or $0$.
Now since $\varphi$ is injective, for each $m$ there must exist some $n$ such that $\varphi_{mn}\neq 0$. Thus for each $m$, there exists some $n$ such that $\varphi_{mn}$ is an isomorphism, and hence $T_n\cong S_m$. Moreover, $\varphi_{mn}=0$ for all $n$ such that $T_n\not\cong S_m$. This means that image of the restriction of $\varphi$ to $S_m$ is contained in the direct sum of all the $T_n$'s which are isomorphic to $S_m$.
Now fix an irreducible representation $R$ and let $A\subseteq V$ be the direct sum of all the $S_m$'s that are isomorphic to $R$, and let $B$ be the direct sum of all the other $S_m$'s, so $V=A\oplus B$. Similarly, let $C\subseteq W$ be the direct sum of all the $T_n$'s that are isomorphic to $R$, and $D$ be the direct sum of all the other $T_n$'s, so $W=C\oplus D$. The discussion above shows that $\varphi(A)\subseteq C$ and $\varphi(B)\subseteq D$. Since $\varphi$ is surjective, we must have $\varphi(A)=C$ and $\varphi(B)=D$. Thus $\varphi$ gives an isomorphism from $A$ to $C$. It follows that the number of $S_m$'s which are isomorphic to $R$ is equal to the number of $T_n$'s which are isomorphic to $R$, which is exactly what we wanted to prove.
Note that you're right that, for instance, $\varphi(S_m)$ might not actually be equal to any of the $T_n$. For instance, if $G$ is trivial, this is just saying that if you have two bases for the vector space, you can have a vector in one basis that is not a scalar multiple of any single vector in the other basis. But $\varphi(S_m)$ is still isomorphic to one of the $T_n$. Moreover, $\varphi(A)$ is actually equal to $C$, or in the language of the question, $\varphi(V_i^{\oplus a_i})=W_j^{\oplus b_j}$ for some $j$. So while the individual irreducible summands might not map to individual irreducible summands, when you group together all the irreducible summands of a given isomorphism type, they map to the sum of all the irreducible summands of the same isomorphism type.
Solution 2:
Consider the identity map $id: V \to V$. Since $id$ is bijective and commutes with the $G$-action, it is an isomorphism of representations. This implies that for any decomposition $$V= \bigoplus_j W_j^{\oplus b_j}$$ it must be that for each $W_j^{\oplus b_j}$ there exists $V_i^{\oplus a_i}$ such that $id(W_j^{\oplus b_j})=V_i^{\oplus a_i}$, otherwise incurring a violation of Schur's lemma. To see this, note each $W_j$ and $V_i$ are irreducible and hence any homomorphism of representations from one to the other is either the zero map or an isomorphism. But since $id$ is bijective, this means each $W_i$ is isomorphic to its image. This implies that up to a permutation of the factors, the decomposition is unique.