A former Marine dressed in black and carrying extra ammunition ambushed police in Baton Rouge, shooting and killing three law enforcement officers less than two weeks after a black man was fatally shot by police there in a confrontation that sparked nightly protests that reverberated nationwide.