“Thanks to these two dedicated officers, a tragedy was averted and two lives were saved,” the sheriff’s office said