Yes. the balls will start rolling in the direction in which the train was moving. Due to the application of the brakes, the train comes to rest but due to inertia the balls try to remain in motion, therefore, they begin to roll. Since the masses of the balls are not the same, therefore, the inertial forces are not same on both the balls. Thus, the balls will move with different speeds.