Normally, diesel and electric locomotives of today have methods of braking while going downhill.
In the days of steam, other methods were used. In the Indian subcontinent have the heavily trafficked ghat sections to the south-east and north-east of Mumbai. These were electrified in the mid-1920s.
Here is a picture of a downhill goods train on one of these routes before electrification:
Here it is mentioned that there are three “special weighted brake vans” after the two locos to comply with regulations. Perhaps the idea was to have higher adhesion on the tracks to prevent them from moving too quickly on the downgrade.
This line had a maximum gradient of 1 in 37. This picture seems to be taken from a catch siding.
Elsewhere in undivided India, there was a BG line with even steeper gradients of 1 in 25, on the line leading up the Bolan Pass to Quetta and beyond. Here, the regulations specified having “skeleton” brake vans of low tare weight and no cargo which were added to downwards goods trains to provide extra braking power but with less weight than regular brake vans.
Here is an example of these wagons, taken from a video from Pakistan shot in 1982:
This was supposed to be at a place between Quetta and Bostan. The gradients are not so severe here, but these must have been destined for a goods train going down the Bolan.