I believe freight cars are just sitting on their trucks, but that's not the case with diesel locos. There are power cables and other lines running between the truck and the engine. If the trucks were not fastened to the loco, a serious derailment like the one pictured below would cause a lot more damage than it does with captive trucks.
Recovering former former model railroader.