Hello,
WooCommerce tool > Clean brand transient would delete the brands cache. But brands list widget does not hide brands that have out-of-stock products. It does not have the option to show only in-stock products. If you want to hide out of stock products from the catalog go to WooCommerce > Settings > Products > Inventory > Hide out of stock items from the catalog.
Regards















