Gangs
Depending on how big the gang is it can take a half hour to an hour to "cut in" and "cut out" a large gang. That's why they have curfews because they lose so much production getting the gangs on and off the track, if they clear too many times, they don't get any production. A section gang only removes a couple ties at a time, so the track isn't made "unsafe" and train can pass at normal speeds. They can clear up in a few minutes. On the other hand a mechanized gang might take out 100 ties at a time and make the track "unsafe". That means the gang has to replace the ties, the track has to be tamped and lined, then because the track has been "disturbed" the train speed has to be reduced. After all the trackwork is done, then the gang has to run to a clearing point at 10 mph. Its a long involved process. After the train passes, the gang has to run back out, then resume work, which means each piece has to complete several hundred feet of production before the next piece can start. The spike pullers have to pull a couple hundred feet of spikes then the tie remover has to remove a couple hundred feet of ties, Then the tie inserters can start inserting ties, next the spikers can spike the ties, then the ballast regulators, and lastly the tampers.. Once they resume work it can be a half hour to an hour before the tamper starts production because of the travel time and them waiting for all the other machines to start work.
Why have a big gang then? Because once they are cut in they can replace a thousand ties over a mile or two a day while a section gang can get maybe a half dozen a day.
Normally a tie or rail gang gets 4-6 hours at least on the track and on double track they might leave a gang cut in on one track continually for weeks. The biggy is the P-811 track renewal machine where the front of the machine rides on old track and the rear of the machine rides on 100% new track, new rail, all new ties. That is cut in for 8-10 hours a day on single track and weeks straight on multiple track.
A welder can do "shots", little segments of an hour or two and a single tamper might get by with an hour or two at a time.
The rail detector cars are necessary evil. They have to have a curfew too because whoever the owns the detector car doesn't want it run over and often they have to back up and retest an area or they have to get out and hand test an area. But the real problem with a detector car is that its purpose is to find rail defects. And it does. That means there has to be one or two gangs following the detector cars to change out defective rails or else there will be bunches of 10 mph speed restrictions following the car. Track geometry cars are almost as back but don't generate as severe speed restrictions. More are in the 25 or 45 mph range, but they can be miles long. While nobody likes the detector cars, its better that they find the defects than a train.
In the summer time, on important lines, every afternoon between 2 and 4 (the heat of the day) there will be track patrols inspecting the track for signs of stress in the rail due to expansion from the heat. They are very high priority and dispatchers will hold trains to run track patrols if they have to. If they find a place that is starting to move, they will call out a gang and they will cut a piece out of the rail to take care of the expansion.
In the winter, the first couple of cold snaps (when the there is a temperature swing of 50-60 degrees or more) starting about 1am and lasting until about 6am the rails will start to break. On some railroads, they will put signal maintainers and section gangs on the night shift in anticipation of this. As the rails go snap crackle pop, the signal systems drop to red, the signal maintainers isolate where the rails are broken and patrol to find the broken rail, then a gang is sent to patch the rail. Back in the day, if the break wasn't too bad (clean vertical break in tangent track), they would "walk" a train over a broken rail. Not as much any more. The worst night I ever had was over about route 5000 miles of main (three divisions), we had about 100 broken rails. Normally, if the break is clean they will pull the rail ends back together, drill holes and put joint bars over the break. If its a jagged break or large chunks of the rail are broken out, they will have to replace a rail (or half a rail).
In jointed rail there is also something called a "stripped joint" (not to be confused with a strip joint). A stripped joint is when jointed rail contracts and one rail shears all the bolts out of a joint bar. Also a bad thing.
At a later date, gangs will have to go back out and replace all the temporary fixes and patches.