If a request times out, Passenger lets your application know (connection half close).
SQL queries are not run by Passenger but by your application and the database. I can imagine that the database just keeps running the query for however long it takes, unless the application does something special to kill it (which, depending on the database, may not even be supported).
- Daniel