For a join, there is no reliable way to tell or ensure in what order tables are locked. If you need an explicit order, then you would need to execute multiple statements, for example
select * from table_a where ... for update;
select * from table_b where ... for update;