The officers stole money from a prostitute and groped her while on patrol duty in Queens, prosecutors said.