Independently corrected solution.
Machine A packed 250 − 245 = 5 more boxes than Machine B. Both started with the same mass, so these 5 extra boxes contain the difference in remaining biscuits.
700 g = 0.7 kg. Difference in remaining mass = 1.5 − 0.7 = 0.8 kg. Mass in each box = 0.8 ÷ 5 = 0.16 kg. The divisor is 5, not the 6 written in the supplied workings.
Check: A started with 250 × 0.16 + 0.7 = 40.7 kg; B started with 245 × 0.16 + 1.5 = 40.7 kg.