According to other reports, the Marines were seated next to the train car’s lavatory. The jihadi decided to assemble and load his AK in there and the very distinctive (not to mention loud) sound of the AK going off safe and chambering a round is what alerted the Marines. Dude came out, started shooting and got piled on by the Marines.
This explains it. As one who have heard those sequence of sounds in a combat situation, it is something that you never, never forgets. It could not be anything else. Well done, Marines.