Electricity wouldn't scale. Solenoids on each brake system would take current. Adding new cars would increase the load on whatever is providing that current. To ensure that cars could be swapped in and out, the cables on all cars would have to be large enough to provide current for even the longest train.
Air brakes, once pressurized, don't take much to maintain. Relatively small pipes work on even very long trains. You can add cars all day without increasing the steady load on the compressor. A longer train will take longer to pressurize, but once there it would not need the compressor to run constantly. Air is also not as dangerous as running large electrical cables the length of a train.