Train models have to be loaded before you use the script command.
mp.game.streaming.requestModel(mp.game.joaat("freight"));
mp.game.streaming.requestModel(mp.game.joaat("freightcar"));
mp.game.streaming.requestModel(mp.game.joaat("freightgrain"));
mp.game.streaming.requestModel(mp.game.joaat("freightcont1"));
mp.game.streaming.requestModel(mp.game.joaat("freightcont2"));
mp.game.streaming.requestModel(mp.game.joaat("freighttrailer"));