Partially wait listed tickets will not be cancelled automatically. You have to file TDR at irctc portal. The wait listed passengers 3 and 4 may be permitted to travel along with you at the discretion of the TTE and if you can adjust within the two confirmed berths you have and the co passengers do not object. If you plan to cancel the ticket, I will advise you to get passenger not traveled certificate from the TTE.