Kamran, those items are used to protect other track from runaway cars.
Like if you have a factory which is served directly from a mainline, you put derails on the factory siding to rather have a single car derailed then having that car running loose on the main and wreaking havoc.