difference between scaling/normalizing data at a specific step
Case I -
With a single scaling step, you might leak the test info into the train. In this approach you have a common min/max otherwise it would have been two pairs
See, the plot for one of the Features of Iris dataset
Also, we don't scale the target. But I see this in your code.
 
Case II -
 This is fine but you should also consider the online cases, where you will not have a test set to scale the new test data.
Case III -
 This is a better and an agnostic approach.
Your code implementation incorrect as suggested in the comment