Royal Challengers Bangalore kept their IPL playoff hopes alive after beating Chennai Super Kings by 24 runs in an eight-over slog.