After giving it some further thought, I tried the following (which seems more logical) but that doesn't work either...
*** ctx-test.tex ***
\starttext
\doifmode{mode1a}
{mode1a}
\doifmode{mode2a}
{\blank mode2a}
\stoptext
*** ctx-main.ctx ***
<?xml version='1.0' standalone='yes'?>
<ctx:job>
<ctx:preprocess/>
<ctx:flags>
<ctx:include name='ctx-flags.ctx'/>
</ctx:flags>
<ctx:process>
<ctx:resources>
<ctx:include name='ctx-modes1.ctx'/>
</ctx:resources>
</ctx:process>
<ctx:postprocess/>
</ctx:job>
*** ctx-flags.ctx ***
<?xml version='1.0' standalone='yes'?>
<ctx:flag>texengine=luatex</ctx:flag>
<ctx:flag>interface=en</ctx:flag>
<ctx:flag>result=ctx-modes</ctx:flag>