The officers - identified as Vitaly Pelevin and Alexei Reshetov - also uploaded the video online, the investigative committee said.
Police said they were sacked and that 12 of their superiors will face unspecified penalties over the scandal.
The incident took place June 17, but police attempted to cover it up, investigators said.
They did not identify the victim or the alleged rapist, saying only that the latter is 34 years old and attacked the inmate when waiting for questioning in pre-trial detention.
If charged and convicted, the policemen face up to three months in prison for negligence.
Russian police have earlier figured in scandals involving detainee abuse. In February, a man with a criminal record was raped to death with a champagne bottle by officers at a police precinct in Tatarstan.