As a former MOS 5831 (Naval Correctional Specialist) in the Marines, it was most commonly used as a term to self describe ourselves, the staff of the brig. If you were asked by a Marine from another unit what you did you would respond that you were a "brig rat". That was regardless of role. A brig cook would use there term as willingly as a guard. We were brig rats.