Get lines of pg_hba.conf with trust method from user with minimal privileges
You are nearly there, just have to process the output from pg_read_file() as it returns each line of pg_hba.conf as a single value.  The following query will do the trick:

WITH file (line) AS (
    SELECT regexp_split_to_array(a, '\t+') 
      FROM regexp_split_to_table(pg_read_file('pg_hba.conf'), '\n') AS t(a)
     WHERE a ~ '^[^#].*trust\s*$'
)
SELECT line[1] AS type, 
       line[2] AS database, 
       line[3] AS username, 
       CASE WHEN array_length(line, 1) = 4 THEN NULL ELSE line[4] END AS range, 
       CASE WHEN array_length(line, 1) = 4 THEN line[4] ELSE line[5] END AS method
  FROM file;


This might not work in all cases that are possible in pg_hba.conf, though - you can tweak this query if you need to.

As you already noticed, pg_read_file() can be run only by superusers.  This is the very reason why you need SECURITY DEFINER on your function.  In order to make it work, you have to create the function as a superuser.  (Note that changing owner after a non-superuser created the function doesn't work.  If this is your case, drop the function first an create it anew, as a superuser this time.)