To move the harvested crop to the mill, workers laid more track in the area where the sugarcane had been cut. The sugar was processed at the mill. The cane was crushed and the juices boiled into sugar. (Note the mill in the foothill of the mountain.)
For more on Hawaiian sugar plantation life, see the A More Perfect Union website link below, or read:
Pau Hana: Plantation Life and Labor in Hawaii 1835-1920, Ronald Takaki. Honolulu: University of Hawaii Press, 1983.
(Currently, the locomotive can be seen at the Railroad Museum of Pennsylvania, Strasburg, Pennsylvania.)