It depends on how far away the candle is from the rope.
If its close enough to burn the rope its also close enough that with a bit of bouncing and physical efforts you can get the rope to sway and gain enough slack to knock the flame out.
If its any further away its highly unlikely the rope will ever get hot enough to start burning. Any slight natural air turbulences will be continually pushing too much of the heat away from the rope for it to ever go exactly strait up long enough to get the rope to start on fire. Plus if you can keep the rope swaying and moving it will further reduce the chances that much more.
Its not impossible of course but given that most rope is dense enough that it will need a fairly steady application of heat to get it to burn and stay burning putting the odds strongly in your over all favor.
Plus the burning candle flame is continually getting further away any way which is greatly increasing the odds of the rope ever burning with every passing second.
So at that distance just keep wiggling and let the candle burn out and hope that the higher blood pressure in your head doesn't give you a nose bleed that just encourages the lion to try harder.
But more importantly someone had to put you there in the first place.
So consider it wise to not piss off the locals who own ropes and candles and have twisted ways of entertaining themselves!
If you somehow managed to get yourself into that situation by accident without any external assistance that is just survival of the fittest doing its job!