OK I resolved it, the issue was the train.dat file, not the extension.cfg file.
So I just put the train.dat file from the 8 car set to the 4 car set folder, then I still had 4 grey boxes behind the 4th car, so I changed the Numbers of motor cars from 24 to 12 in the train.dat file and Voilą.
So the reason why the cab was completely out of the tracks and the sounds were high pitched was because of the position values (X,Y,Z) and the acceleration values, resulting in sound modification.
So if you have the same problem, do this.