Building a filtering system using both OR and AND relations
I've looked at it further and arrived at a solution.

The relations array needed to be in the form ['and', {element: [22, 33]}, {element: [42, 43, 44]}, {element: 65}].

So that could be done using the following:

{% set relations = relations|merge([{element:filterValues}]) %}