I'd outright reject raising the y.
Here's a comparison between your \smash
method and my method of equalizing the subscripts.
\documentclass[12pt,letterpaper,twoside]{book}\usepackage{lmodern}\usepackage{amsmath}\usepackage{fixcmex}% don't forget this if you use lmodern\usepackage{xcolor}\newcommand{\arule}{\rlap{\color{red}\smash{\vrule width 1cm depth0.1pt height 0pt}}}\begin{document}\begin{alignat*}{2}&\frac{\arule p_x^{\arule 2}}{2 m} \frac{p_{\smash{y}}^2}{2 m}&\qquad&\frac{p_x^{2}}{2 m} \frac{p_{\smash{y}}^2}{2 m}\\&\frac{\arule p_{\mathstrut x}^{\arule 2}}{2 m} \frac{p_{\mathstrut y}^2}{2 m}&&\frac{p_{\mathstrut x}^{2}}{2 m} \frac{p_{\mathstrut y}^2}{2 m}\end{alignat*}\end{document}
You might also try \smash[t]{\mathstrut}
, exploiting the fact that neither letter has ascenders.