In forming a passenger train, freight or merchandise or lumber cars shall not be placed in the rear of passenger cars. If they, or any of them, shall be so placed and any accident happens to life or limb, the officer or agent who so directed or knowingly suffered such arrangement, shall be guilty of a misdemeanor, and, upon conviction, shall be fined not less than fifty dollars nor more than five hundred dollars. This section shall not apply where railroad trains are carrying personnel and equipment in connection with military or naval movements.