Is it legal to continue building a route after it has been cut off by an opponent's settlement?
Yes.
The rules state that that you must build connected to your own buildings/roads, which you still are in the situation in question.
From the rules:

A new road must always connect to 1 of your existing roads, settlesments, or cities. Only 1 road can be build on any given path.

And

You must meet 2 conditions when building a settlement:



(1) Your settlement must always connect to 1 or more of your
own roads




(2) You must observe the Distance Rule