No, this above will not work.
If you got a support contract, then better open a case so deeper research on this can be done.
web 6.1 is very old and do not have the backreference $1 , etc, capability as in web 7.0.
If this is web 7.0, then something like this can be possible,
<If $uri="/def/index.jsp" and $query =~ 'query=(.*)' >
NameTrans fn="redirect" url="https://www.xyz.com/abc.jsp?query=$1"
I reemember I did some 6.1 long time ago, but it will take a lot more time to research into it.
Worst case, you can write an NSAPI plugin to do this request redirect.
this will not have the
"the original url (for the PDF) being passed in the query string (or even a form variable)"
It will redirect uri="*.pdf" to the same web page at "http://host:port/getFile.cfm" without any query string needed.
still will not work, because they need a redirect like http://host:port/getFile.cfm?filename=xxx.pdf
The hard part is there is no backreference available in web 6.1 like $1 in web7, so not easy to carry this over to the redirect after the match given xxx can be a different name in any request. The match is fine, but the backreference in the redirect is the difficulty.