The problem is that your first condition checks whether the two object are at exactly the same position, so all those more relaxed if statements after that are pointless. Instead, you probably just want to check whether the difference between the centres of the two objects are less than 50px apart. You can easily check this using the absolute difference.
if (Math.abs(trainer.getPy() - squirtle.getPy()) < 50 &&
Math.abs(trainer.getPx() - squirtle.getPx()) < 50) {
trainer.dead();
Skully skull = new Skully (trainer.getPx(), trainer.getPy());
}