Freight transportation in railway networks with automated terminals: a mathematical model and MIP heuristic approaches