A “line in the sand” was drawn when the rail unions were forced into a “cooling off period” after months of industrial brinkmanship, a court has been told.