Hmmm...something seems off here. Even a rather large peppermint shrimp should not be able to remove a healthy hermit crab from its shell, except perhaps for perhaps a very, very small hermit or one in a shell that doesn't cover the animal properly when retracted (sign of not enough shells as mentioned). Usually when hermits are pulled from their shells by another animals it is because they're weakened from something else (difficulty molting, etc.). Sometimes they will abandon ship voluntarily if the shell is in poor shape (such as having holes in it) or was too poor-fitting to offer protection - but then they are usually pretty good at making a run for it, as naked healthy hermits are amazingly fast.
Anyway, isolate the affected crab in a bowl of tank water and offer it larger empty shells as mentioned. If it won't inspect the shells while you're watching, put it in a quiet place and leave it be for a while, but check it every 15min or so. Once it leaves the smaller shell, remove the shell to make sure it doesn't change its mind. The last thing it needs is to get stuck if the abdomen swells in response to irritation/injury. Make sure the new shells are clean - stressed hermits, especially naked ones, will often ignore shells if they would have to clean them out to make them livable. They may also ignore shells recently worn for a long time by other hermits, which I presume must be due to the shell still smelling like another animal. Ideally I would keep a hermit in this condition isolated until it molts again, thereby demonstrating that it is healed and ready to return to a competitive environment. A container of tank water partially changed daily with an air bubbler and regular pelleted food should be enough for that, nothing too fancy. Alternatively, once in an approprite shell, injured hermits can be kept in-tank a breeder net/box, which is by far the easier approach if there is room in the tank or sump.