be is a copular verb and it's used to connect the subject of the sentence to the complement - a subject complement.
The solution is easy.
The order will be delivered soon.
He is a policeman.
In the above sentences the verb be connects the subject to its complement. A complement need not be an adjective only, but anything that says something about the subject.
In sentence #1 the complement is an adjective. In sentence #2, the complement is past participle of verb (or can be viewed as an adjective), but in sentence #3 the complement is a noun phrase.
All these complements say something about the subjects. And hence they are called subject complement. A copular verb is the one that links the subject with its complement.
In your quoted sentence the complement is - to be out. This is an infinitive clause denoting the purpose of his scaling. out here is an adverbial modifying the verb be and referring to the position of the subject.
Rajnath gets stuck in lift, scales wall to be out.
Scales the wall so that Rajnath comes out.