You could use these two INSERT queries, the second one with a JOIN:
INSERT INTO table2 (category_title)
SELECT DISTINCT category_title FROM table1;
INSERT INTO table3 (subcategory, table2_id)
SELECT DISTINCT subcategory, table2.id
FROM
table1 INNER JOIN table2 ON table1.category_title=table2.category_title;
Please see fiddle here.