Liverpool Crown Court heard how, on 5 March 2015, both firms were upgrading Water Treatment Works in Cheshire.
During commissioning work, a worker’s foot became trapped in a large rotating screw which led to the amputation of three toes.
An HSE investigation found that both companies had failed to properly plan and manage the commissioning work.
Costain and Galliford Try were found guilty of breaching the Health and Safety at Work Act 1974.
Both companies were fined £1,400,000 each with a total of £101,046.20 costs.
Speaking after the case, HSE inspector David Argument said: “This injury was easily preventable. The commissioning work should have been properly planned and managed.
“Employers should make sure they properly assess and apply effective control measures to minimise the risk posed by dangerous parts of machinery.”