It does vary by location but many hold that law enforcement officials are always on duty. If they are within their jurisdiction and they see some wrongdoing; they are obligated to intercede.
Maybe on duty, but that whole "officer's discretion" crap means they're really not obligated to do anything, at any time.
AFAICT, at least for Texas, a sheriff (and possibly his deputies - not sure how that works outside their shift) is required by the state Constitution to arrest and deliver before a magistrate any person he observes committing a criminal offense. No time or place restrictions. (Interestingly, nothing limits this duty to his county, either.)