Why would a rise in the discount rate stop foreign gold drain and make banks fail?
An increase in the discount rate increases the cost of borrowing for commercial banks.  Their normal response would be to

(a) Offer higher interest rates to depositors to replace loans from the Reserve System, and

(b) Increase commercial interest rates on the loans they offer to pass on their higher costs to customers.


This makes it more attractive for individuals (including foreign ones) to deposit gold or pay back loans, together "arrest[ing] withdrawal".


I'm not sure it would and couldn't find this implied in the text.
Because their cost of borrowing has gone up sharply.  If they can't get rid of this cost by calling in loans or attracting savings, or offset it with profits, then they'll go under.  And if they quickly pass on higher interest rates to borrowing customers, this is likely to lead to bankruptcies and foreclosures, so they have to write off loans, and go under.