Police: Off-duty cop foils would-be robbers