Extract of 197 CRPC
Section 197 in The Code Of Criminal Procedure, 1973
197. Prosecution of Judges and public servants.
(1) When any person who is or was a Judge or Magistrate or a public servant not removable from his office save by or with the sanction of the Government is accused of any offence alleged to have been committed by him while acting or purporting to act in the discharge of his official duty, no Court shall take cognizance of such offence except with the previous sanction-
(a) in the case of a person who is employed or, as the case may be, was at the time of commission of the alleged offence employed, in connection with the affairs of the Union, of the Central Government;
(b) in the case of a person who is employed or, as the case may be, was at the time of commission of the alleged offence employed, in connection with the affairs of a State, of the State Government: 1 Provided that where the alleged offence was committed by a person referred to in clause (b) during the period while a Proclamation issued under clause (1) of article 356 of the Constitution was in force in a State, clause (b) will apply as if for the expression" State Government" occurring therein, the expression" Central Government" were substituted.
9.3 As laid down by the Supreme Court, a public servant can be said to act or purport to act in the discharge of his official duty, if his act is such as to lie within the scope of his official duty. A judge neither acts nor purports to act as a Judge in receiving a bribe though the judgment which he delivers may be such an act; nor does a Government Medical Officer act or purport to act as a public servant in picking the pocket of a patient whom he is examining though the examination itself may be such an act. The acid test is as to whether the public servant can reasonably be inferred to have acted by virtue of his office. What is important is the quality of the act. The question whether an offence was committed in the course of official duty or under colour of office depends on the facts of each case (Baijnath vs. State of Madhya Pradesh, AIR 1966 SC 220: 1966 Crl.L.J. 179 (SC); S.B. Saha vs. M.S. Kochar, AIR 1979 SC 1841:1979 Crl.L.J. 1367 (S.C.)). The Supreme Court held, in the case of R. Balakrishna Pillai vs. State of Kerala, AIR 1996 SC 901, where the accused, Minister of Electricity, Government of Kerala, is alleged to have supplied certain Units of electricity without the consent of the Government, that the alleged criminal conspiracy has direct nexus with discharge of his official duties and that as such sanction is required for his prosecution under sec. 197 Cr.P.C.
Refer this link also:
Public servants can be prosecuted without prior sanction: SC - timesofindia-economictimes
Point here I wish to make is if the Inspector is doing wrong things and there is evidence,all a citizen can do is to put it in black and white to the department concerned.
And further if department fails to act, a court can be moved by complainant.