I would have done this in a slightly different way. Let x be the TIME, in hours, spent at 50 km/h on flat land. Then using TKHunny's "Distance = Rate * Time" the train will have gone a distance of 50x km on the flat land. Let y be the TIME, in hours, spent at 10 km/h on the slope. The train will have gone 10y km on the slope. We are told two things: that the total distance covered was 50 km, so 50x+ 10y= 50, which is equivalent to 5x+ y= 5, and that it took "2 hours and 12 min"= 2+ 12/60= 2+ 1/5= 2.2 hours so x+ y= 2.2.
So the problem becomes to solve the two equations, x+ y= 2.2 and 5x+ y= 5. There are many different ways to solve "two equations in two unknowns" but here the simplest, perhaps, is to solve for y, y= 2.2- x, and replace the "y" in the second equation with that: 5x+ 2.2- x= 4x+ 2.2= 5. 4x= 5- 2.2= 2.8. x= 2.8/4= 0.7. Since y= 2.2- x, y= 2.2- 0.7= 1.5.
Now, the question was "how much of the journey was on the flat land and how much of the journey was on the slope". In my mind that is ambiguous. Does "how much of the journey" refer to time or distance? In terms of time, x= 0.7 hrs, 0.7/2.2= 31.8% of the journey was on the flat land, while y= 1.5 hrs, 1.5/2.2= 68.2%, was on the slope. In terms of distance, 0.7(50)= 35 km, 35/50= 70% of the journey was on the flat land, while 1.5(10)= 15 km, 15/50= 30% of the journey was on the slope.