Yes both the accelerations will be same.
You can even understand it logically.
At max extension both the blocks should have same velocity becoz if thier velocities are different then one of the block will have some velocity w.r.t the other and hence the condition of max extension will not hold good.
Now when we have decided that they should have same velocities, its obvious that their individual acceleration should be same, Becoz all motion,veloctiy and acc are in same direction and any difference in acc between the 2 blocks will change their velocities.
Hope you understood. If not nudge me.