Solomon speaks about events that he thinks could happen in the future. The situations he describes in verses 36-38 are conditions for what he requests verse 39.
This can be stated in active form. Alternate translation: "where their enemies have taken them as exiles" (See: [[rc://en/ta/man/jit/figs-activepassive]])