Well, yes and no. Rats that are pre-killed for food are gassed or killed by cervical dislocation, both of which are fast and painless if done correctly. When a snake kills a rat death is by cardiac arrest, and the feeder loses consciousness in seconds.
OTOH stabbing the snake would be a very long and painful death for the snake, unless done by pithing the brain.