CSX train hauling crude oil somehow lost 41 of its 113 tankers, leading to a derailment of 18.

East Chicago, Indiana, during yesterday’s evening rush; fortunately there was no leakage. How did all those cars get disconnected from the rest of the train?

I’m not interpreting the story the way you are. It sounds like 18 cars derailed, which led to 41 cars becoming disconnected. Which makes more sense. Some cars somewhere in the middle of the train derail, but the locomotives are still moving forward, the train’s going to break at some point.

News reports on Chicago-area TV and radio stations are saying that the disconnect came before the derailment. Here’s one.

This is not uncommon and generally happens either when a coupler ‘knuckle’ fails, or the entire coupler and drawbar pull out of the end of a car. Here are two examples (in one short video):

Normally, when this happens, the air hoses separate and the train brakes go into emergency. In some cases, the trailing section doesn't slow as quickly as the leading section and the two parts collide, sometimes hard enough to derail; this may have been the case in the derailment mentioned in the OP. This is what happens in the second example in the video, although no derailment ensues in that particular incident.

Thanks for the info! Ignorance fought.