Most parishes have a stipend that is paid for any special Masses - funerals, weddings, etc. It generally covers the expenses of opening and running the church (heat, ac, lights, candles, etc.), paying the organists, etc. In my personal experience, it was one of the line items at the funeral home and the funeral director took care of the money exhange.
In most cases, the parish would work out a reduced fee or a payment plan for a family that couldn’t afford the stipend but if the deceased or the family were not really practicing Catholics in the parish, that conversation would be trickier.

I know our pastor is very sensitive about using parish resources at the request of people who have not been part of parish life up til then.