Braking is provided by a mechanism that is similar to a car drum brake. An air-powered piston pushes a pad against the outer surface of the train wheel.
In conjunction with the mechanical brakes, the locomotive has dynamic braking. In this mode, each of the four traction motors acts like a generator, using the wheels of the train to apply torque to the motors and generate electrical current. The torque that the wheels apply to turn the motors slows the train down (instead of the motors turning the wheels, the wheels turn the motors). The current generated (up to 760 amps) is routed into a giant resistive mesh that turns that current into heat. A cooling fan sucks air through the mesh and blows it out the top of the locomotive -- effectively the world's most powerful hair dryer.
On the rear truck there is also a hand brake -- yes, even trains need hand brakes. Since the brakes are air powered, they can only function while the compressor is running. If the train has been shut down for a while, there will be no air pressure to keep the brakes engaged. Without a hand brake and the failsafe of an air pressure reservoir, even a slight slope would be enough to get the train rolling because of its immense weight and the very low rolling friction between the wheels and the track.
The hand brake is a crank that pulls a chain. It takes many turns of the crank to tighten the chain. The chain pulls the piston out to apply the brakes.