I suppose there's a small chance that just "banging" the batteries might help - regardless of polarity or direction, however. (I do like the suggestion that the electrons just need to be knocked back to the negative end!!)
Although you think of a battery as an electro-chemical system, there are also some mechanical factors involved. As the battery compounds are charged/discharged, they expand and contract slightly as their chemical state changes. This is what causes your car battery to go dead - some of the lead plates basically fall apart and short things out.
Think also of battery leakage. While chemically driven, there certainly are mechanical changes. Many batteries swell up as they die and leak.
I don't know about NiMH or NiCads, but I suppose there might be mechanical changes in them, too. So, a good bang might break up something that has gone wrong, such as dislodging a minor short circuit.
As Ron suggested, try it and see what happens!