If you are under time pressure to learn a song, firstly decide if the part you're struggling over is important to the song or not. If it isn't then you can either work on what's troubling you or play something else in its place. If you're short on time, get the song in shape so that you can play it in the band. Then go back and look at what is stopping you from playing the bit you changed. It's a "hole" in your technique so work out why it's a problem. Is it speed, fingers, right hand, left hand? Fix it at your own pace and add it to the song when you are comfortable.
Slow the line down and break it into smaller sections, even down to a bar, and when you understand it play slowly putting it all back together again.
For immigrant Song, work out the framework but I doubt if JPJ played it the same every gig, so don't try to lean every note in the sections where he's jamming.
As a starter just simplify it down to the basic feel, slow it down, then build up playing the root notes in tempo until you get used to playing it for 5 mins at that intensity. When you can do that start to extend and expand what you are playing.