Bubba,
JR has your answer.
To expound on his response,
In yards where the cut of cars is to be switched or sorted out, the air brakes are bled off.
The basic concept is the air brakes are a 2 part system, and as long as the system is charged with air, if the train line breaks in two, the air brakes set up, or if the engineer draws some air away from one side of the system, the brakes set.
Look at photos of railcars, and on the side near the bottom center you will see a stenciled label that states “release valve” or Release rod"
Pulling this rod empties the entire air system on that car, allowing us to flat switch the car, in essence they can roll freely because they have no working brake system other than the hand brake.
In the movie, I can only assume that either the “39” cars were either a switch cut waiting to be sorted, or a train made up but not yet worked for air.
The car department will lace all the hoses up, charge the brake system with air, set the brakes and inspect the entire train, both side, for any defect.
We often couple several yard tracks together and set them over as a large train, all with out air, and then leave these cars on ground air for the car department to work.
Also, in the real world, if the air brakes had been charged up, but both anglecocks on the either end of the train, front and rear car, were closed, then the cars could roll free with out an emergency brake application. Of course, if that had been the case, then all that the conductor, Chris Pine, would have to do was open the rear anglecock on the last car when they coupled into the runaway, and the runaway would have gone into emergency braking.
But that would have ruined the whole movie, so…
Besides, they have Denzel working the automatic or train brake handle when he says he is working the independent or locomotive only brake handle.
The movie is full of small inaccuracies simply because the directors/producers didn’t