与其 + [verb phrase: rejected],[subject] + 宁可 / 宁愿 / 宁肯 + [verb phrase: chosen]
与其…宁可 sets two options side by side and states which one the speaker chooses: "rather than A, I'd rather B". The option after 与其 is rejected; the one after 宁可 is chosen, usually at some cost – more effort, more time, going without. 宁愿 and 宁肯 can replace 宁可 with the same meaning.
The subject usually comes before 宁可 in the second clause.
与其…不如 is a judgement: B is the better option, often as advice to someone else. 与其…宁可 is a resolve: the speaker – or the subject – has decided on B and accepts what it costs. The 不如 frame has its own point.
English "I'd rather B than A" puts the choice first. Here 与其 marks the rejected option and always comes first.