My friend Bob Bartizek (Pennsylvania & Western), like many of us, ended up with slight grades on some sidings, usually just from mild undulations in track or benchwork. While almost imperceptible in the trackwork, today's needlepoint axles and metal wheels would mercilessly root out the imperfections, and cause spotted cars to un-spot themselves at will, and sneak along to unapproved locations on the spur. And in some cases, they'd merrily roll all the way out into the traffic fray.
Some of us use retractable "tie-downs" or "track brakes", but these take a lot more work to install than is merited by a spur. They are most appropriate on thoroughfare track with substantial grades. Some in the group use "whiskers" of stiff nylon line that will hold a car by the axle, yet are nearly invisible and can be powered through. This is deft, and a huge help in Denver's 36th St. yard on Jim Rollwage's Denver Pacific (UP), which can hold at least 14,000 cars. A minor quibble with this method is that a whisker stiff enough to stop a heavy car, or especially a whole cut, can derail a light car. Although, this is not a problem on Jim's layout, as the fleet is pretty consistently weighted, the grade is slight, and the whiskers are not called upon to hold long cuts.
Bob's solution on his O scale PRR layout was to use a bead of super-glue on the railhead. This forms a bump that will hold a car, but like an asphalt speed bump, can be conquered with horsepower. I am going to say this even though it should be obvious to almost any sentient human, because it was not to me the first time I heard about it: it is a bump of dry super-glue. One is not actually gluing one's rolling stock in place. (It was a relief to me, and a vast simplification, to hear that clarified.)