AP physics 1 and 2 cover different topics in physics.
However, these AP tests will not give useful subject credit for an engineering major. Engineering majors need to take calculus-based physics, so non-calculus AP physics 1 and 2 will not be accepted for subject credit for engineering majors’ physics courses.
For a mechanical engineering major, AP CS credit is unlikely to give useful subject credit. If the student wants to learn about CS for learning sake, that is fine (https://cs10.org may be a good way to get an introduction and overview of CS; it is a college course that AP CS principles is modeled on), but possible AP credit should be of low priority.