Multi-train trajectory optimization for energy-efficient timetabling