A crawler crane, a locomotive crane, or a truck crane, as defined in the definitions of occupational safety and health administration standards of the United States Department of Labor, which operates upon a railroad track and has a boom which extends 12 feet or more vertically above the ground or the rails, must be equipped with a warning device able to detect an electrical line which comes within 15 feet of the boom. When an electrical line is detected, no person is required to operate the crane unless the electricity is shut off or the electrical line is rerouted in a manner to prevent contact with the machine. Violation of this section by a person or corporation is a misdemeanor.