Dwellers get XP in three ways:
A small amount from working in a room. This is continuous and will happen even if the game is 'off' but it is very slow.
A medium amount from Rushing (succeed or fail) a room.
A large amount from exploring the wastes.
It's worth noting that each dweller leveling up will only count for the objective once, so if you send a Level 1 Dweller into the wastes, she won't accomplish the goal for you by herself even if she gets to level 23.
One possible solution is to have several single width rooms, put two people you want to level up in the first one, and rush it until they level up. Being a small room, the failures will be easy to deal with. Once they level up, run them through a gauntlet of your other rooms with low chance of failure to bring their happiness back up. Then select your next two level up candidates, put them in the first room and rush until they level up. Hopefully by the time they have the other rooms will have "cooled down" and you can rush them once or twice in each to bring their happiness back up to acceptable levels. Every success/failure increases or decreases happiness by 10%, but happiness won't go below 10% so 9 successful rushes in a row will bring anyone back to 100%. In practice I'd probably be okay with getting my "levelers" back to 60-90% and let them get to 100% again later.
Of course if you don't have the budget to build a bunch of easily rushable rooms, or your dwellers aren't trained well enough to recover happiness you might find it easier just to send 24 folks off into the wastes until they level up.