Try with a subselect first order them then group them,normal group by will use the first occurrence of the record , So make it like first ORDER BY service_id DESC
then use group by
SELECT t.* FROM (
select * from billing_billingmatrix
where (provider_id=24
or provider_id is null)
and (service_id=25 or service_id is null)
ORDER BY service_id DESC
) t GROUP BY t.definition_id
Fiddle