One man has died and two men are believed to be in critical condition after being electrocuted while installing a train line at a sugarcane farm near Cairns.

Police Inspector Peter Flori said the men were steadying a length of track suspended from the crane when the boom hit an overhead powerline on Sunday morning.

A nearby resident and first responder said the workers had been replacing rail tracks at the farm for several weeks.