They usually dock them to prevent the rats and such they catch from having something to bite at. You see, I have a rat terrier of my own and her tail is just a nub.
We adopted a Rat Terrier at 4 months who did not have her tail docked or ears clipped. I refuse to do it now, her long, fun tail is too much part of her personality. But we had another RT some years back who was adopted with docked/clipped. Its been interesting to see what the new one looks like eau naturale! Very cute. Breed specifications should change to eliminate docking since Rat Terriers no longer are put in rat bait pits anymore.
Some Rat Terriers are born bobbed tailed and some are born with long tails, I have one of each, My daughter has a littlermate to my female that was born with just a nub and my female was the only dog in the litter of 8 to have a tail, My Male has had his tail docked, which is done at a couple of days old if the littler owner prefers all his dogs to have a bobbed tail. Ratties can be born either way. Some chose not to clip tails.
Many are docked shortly after birth. The breed specifications won't be changed any time soon because many people use them as farm dogs who also hunt. They will naturally hunt and it prevents the prey from biting at that part of them.