I suggest to change the locomotive's item type to item-with-entity-data
. This is how factorio's normal locomotive is defined. That will allow trains to be picked up and placed again without losing their properties. If you do this with locomotives defined with item
like they are now, then the train's color will reset and anything in the equipment grid will be deleted (equipment grids can be added by other mods).