Section 232. If a person is injured in his person or property by collision with the engines or cars or rail-borne motor cars of a railroad corporation at a crossing such as is described in section one hundred and thirty-eight, and it appears that the corporation neglected to give the signals required by said section or to give signals by such means or in such manner as may be prescribed by orders of the department, and that such neglect contributed to the injury, the corporation shall be liable for all damages caused by the collision, or, if the life of a person so injured is lost, to damages recoverable in tort, as provided in section two of chapter two hundred and twenty-nine, unless it is shown that, in addition to a mere want of ordinary care, the person injured or the person who had charge of his person or property was, at the time of the collision, guilty of gross or wilful negligence, or was acting in violation of the law, and that such gross or wilful negligence or unlawful act contributed to the injury.