That depends if you used items and not ability to capture foes.
But here is what i know about exp gain.
You gain exp by working on areas that generate research or gold.
You gain exp by killing invaders in combat.
For captureing enemies, im very sure that you wont get exp if you use items but by using ability Capture.
But if you can confirm that you used Capture cards instead of items to capture invaders, then its probably only possible with only by killing invaders.
Viewing post in combat not leveling up servants
Exp can be gained by:
-Combat against invaders. (Captureing invaders might not give exp)
-Collecting gold generated in the Throne room.
-Working at areas that generate stuff you can collect like gold, medicine, food, and research.
-Finding treasure, gems, prisoners, and technology from sending them to the surface for expedition.
-Expanding your base.
Jails and other rooms that does not generate items will not give exp.