Small and midsize U.S. banks lost hundreds of billions of dollars in recent weeks to their bigger peers and to money-market funds offering higher yields. That is likely to force many of them to increase the interest rates they are paying to avoid losing more customers.