Sensex hits 5-month high, Nifty closes at 24,774 on banking surge