JOIN on "Latest Match" in "Order"
If you can upgrade to MariaDB version 10.2, you can use window functions.

The following assumes that table1 has - for every id - the same or more rows than table2:

WITH
  t1 AS
  ( SELECT id, time, 
           row_number() OVER (PARTITION BY id ORDER BY time DESC) AS rn
    FROM table1
  ), 
  t2 AS
  ( SELECT id, time, 
           row_number() OVER (PARTITION BY id ORDER BY time DESC) AS rn
    FROM table2
  )
SELECT 
    t1.id, 
    CASE WHEN t2.time IS NULL OR t1.time &gt;= t2.time
        THEN t1.time ELSE t2.time
    END AS time,
    CASE WHEN t2.time IS NULL OR t1.time &gt;= t2.time
        THEN 'table1' ELSE 'table2'
    END AS "table"
FROM
    t1 LEFT JOIN t2 
    ON  t1.id = t2.id
    AND t1.rn = t2.rn
ORDER BY
    id, t1.rn DESC ;


Tested at dbfiddle.uk