Instead of a relate, have you tried joining the tables?
Assuming QGIS handles relates and joins the same as ArcMap, you will not be able to query on the relate. Basically, a relate just defines a relationship within the map document, and does nothing to relate the tables in the geodatabase (such as a join). In order to query, a database relationship needs to be defined.
On a quick search for QGIS relates vs joins, I didn't see anything that really spelled out the difference, so I'm using a link to an ArcMap help page that defines relates vs joins. I know it's not QGIS, but I assume that they are defined similarly. Quoted text below in case of future link failure.
ArcMap provides two methods to associate data stored in tables with
geographic features: joins and relates. When you join two tables, you
append the attributes from one onto the other based on a field common
to both. Relating tables defines a relationship between two
tables—also based on a common field—but doesn't append the attributes
of one to the other; instead, you can access the related data when
Typically, you'll join a table of data to a layer based on the value
of a field that can be found in both tables. The name of the field
does not have to be the same, but the data type has to be the same;
you join numbers to numbers, strings to strings, and so on. You can
perform a join with either the Join Data dialog box accessed by
right-clicking a layer in ArcMap or the Add Join geoprocessing tool.
Suppose you obtain daily weather forecasts by county and generate
weather maps based on this information. As long as the weather data is
stored in a table in your database and shares a common field with your
layer, you can join it to your geographic features and use any of the
additional fields to symbolize, label, query, or analyze the layer's
Unlike joining tables, relating tables simply defines a relationship
between two tables. The associated data isn't appended to the layer's
attribute table like it is with a join. Instead, you can access the
related data when you work with the layer's attributes.
Relates defined in ArcMap are essentially the same as simple
relationship classes defined in a geodatabase, except that they are
saved with the map instead of in a geodatabase.