No it is not the Secret of NIMH. I remember a clip from a movie I saw as a child. It was an animated movie and the from what I can recall all, or nearly all of the main characters are rats (maybe mice). In the scene the protagonist discovers that the antagonist is his former best friend. The best friend has become evil due in part to a metal contraption that is on his head. One of the characters has a peg leg, or walks with a crutch? That’s all I can remember
The tale of despereaux??
Flushed Away??
American Tail