It's only immune to your moves for a few turns. After that, a cutscene plays. When that's over with, you can damage it. I recommend bringing quite a few Reviver Seeds and Oran Berries with you. If you don't have any, just do what I do: try it again and again until you finally beat it! It can take a while, so make sure to train up Axew and Pikachu.