How can "that" refer to a word when there are some other words between them

Solution 1:

The word "are" (not "is") immediately after "that" indicates that the antecedent of "that" must be plural, and the nearest (in fact only) candidate is "expressions".

Solution 2:

You're right that it's grammatically ambiguous. But readers use context and common sense to disambiguate.

In this case, the dependent clause contains the noun phrase "those in the source text". So the reader looks for a parallel phrase in the main clause, and finds "expressions in the target text". It's clear that these are the intended comparisons.

It would make less sense to compare "those in the source text" with just "the target text".

When there's less to go on in the semantics, the default is that the most recent noun phrase is the antecedent. But it has to make sense, and we rescan when necessary.