The Snowdon railway's locos push the train up and acts as a brake on the way down as the line is nothing but incline.I've fitted those magnetic couplings to some of my rolling stock.
However, on the Snowdon Mountain Railway, I believe the loco is not physically coupled to the loco. I would assume this is the case for most rack railways (but not the MGB or ZB)....