Ever try running a train under the Christmas tree with a Basset Hound butt blocking the mainline? Immoveable object indeed! Unless of course there’s food involved…
There was an old Model Railroader joke about using a working rotary snow plow to “clear the line”
Seriously, though. Remove the cat’s easy access to the layout surface, and buy a squirt gun. There was a thread a while back on Model Railroader’s community that suggested using an electric floor mat in the doorway to the layout room to keep the cat out. Supposedly, once the cat steps on the pad once, the cat gets a mild shock, and will never step on the pad again. After the first time, you can leave the pad off.
An alternative would be to build some kind of cat-gate (unlikely to work unless your cat is de-clawed), or training your cat to keep out of the train room altogether.
Actually the cat pictured, named Rocky, is a pretty mild mannered cat that does little damage.
One of the other cats is an 18 lb. moose of a house cat that I would not want getting mad at one of my locos and fling it off the tracks if I bumped into him. Fortunately he never goes on the train table he just sits on his throne and rules the house.