That MCAT will not know what hit it!

The 25 kg mass will accelerate due to the 50 kg mass that pushes on the 25 kg mass. To find the force that the 25 kg mass feels we need to use Newton's second law. To find the acceleration of the 25 kg mass we need to also use Newton's second law for the entire system because both of the masses have the same acceleration (which is 2).