In that situation I would rather do A than (I would) (do) B.
If the verb 'do' appears after 'rather' it has to be in the bare infinitive, not in the gerund.
How about that other way of expressing the same idea?
Doing A rather than (do) (?) / (doing) (?) B is the course of action I would choose in that situation.*
The verb 'do' being itself the subject of the verb 'be' has to be in the gerund. If that same verb appears again after 'rather', should it also be in the gerund this time rather than in the bare infinitive?