In such cases, when only one batsman remains not out and capable of batting, the innings is over.
Where such a restriction is imposed in a one-innings game, it is said to be a limited overs match.
If rain intervenes so that all the allocated overs cannot be bowled in the time available for the game, the overs restriction may be modified so that the game may be completed in the time that remains.
The strategic consideration is to gamble a certain draw for a possible victory, while risking defeat if the target is achieved by the incoming batting side.
If the chasing team manages to achieve the target, their innings is ended and they win.