I've had a play with subqueries an this seems to do the trick.
The following code will return all brands.
The records are ordered so brands related with out customer will appear first.
Code:
$cust = new Customer();
$active_id = 3;
// Select count for related customers with given id
$cust->select_func('COUNT', '*', 'count');
$cust->where('id', $active_id);
$cust->where_related('brand', 'id', '${parent}.id');
$brand = new Brand();
// Add to the brand query
$brand->select_subquery($cust, 'is_linked');
$brand->select('*');
// order so linked brands appear at the top
$brand->order_by('is_linked', 'DESC');