Energy per symbol calculation
The first equation, $ \frac{1}{N_s}\sum |x[n]|^2 $, is correct. Applying the RRC filter kind of smears the energy of the symbol over several samples so that when you add them all back up again you get $E_s$, and of course divide by $N_s$ for multiple symbols. The RRC filter should be normalized as someone in the comments noted.
The second equation I can't say much as it is not clear how you compute $P_{avg}$. Secondly, dimensional analysis is a fancy way of saying writing out the units and seeing what cancels out. For example, in the second equation:
$$\text{sps }T_s\rightarrow \frac{\text{samples}}{\text{symbol}}\frac{\text{seconds}}{\text{symbol}}=\frac{\text{(samples)(seconds)}}{(\text{symbol})^2}$$
I've found this method useful as a &quot;sanity check&quot; for myself many times. The above units should suggest to you that something is amiss (also why do you need two equations for the same quantity?).
Edit
The question was updated to include definition of $P_{avg}$. The OP is computing average power per sample and trying to convert it to average power per symbol. Again, write out the units it becomes clear:
$$\frac{\text{energy}}{\text{sample}}\frac{\text{samples}}{\text{symbol}}=\frac{\text{energy}}{\text{symbol}} $$
sps = 4;
Ns = 100;
Es = 10;
rrc = rcosdesign(0.25, 6, sps, 'sqrt');
s = sqrt(Es)*qammod(randi([0, 15], Ns, 1), 16, 'UnitAveragePower', true);
x = upfirdn(s, rrc, sps);

equation1 = sum(abs(x).^2)/Ns;
equation2 = sum(abs(x).^2)/length(x)*sps;