By marking the cut. Or, in more proof-y terms:
Let a number, x or y simply indicate an amount of cards, a J is a joker and A and B are the spectator's cards. The deck is set up like this:
9, J, 18, J, 25
By letting the spectators cut to 1/3 and 2/3, the deck becomes three piles.
1: 9, J, x, A
2: (17 - x), J, y, B
3: (24 - y)
These piles are restored in order 2 - 1 - 3:
2: (17 - x), J, y, B
1: 9, J, x, A
3: (24 - y)
Resulting in the following deck:
(17 - x), J, y, B, 9, J, x, A, (24 - y)
The deck is cut at the jokers (which are removed), resulting in three new piles:
1: (17 - x)
2: y, B, 9
3: x, A, (24 - y)
These are restored in order 1 - 3 - 2:
1: (17 - x)
3: x, A, (24 - y)
2: y, B, 9
Resulting in:
(17 - x), x, A, (24 - y), y, B, 9
or:
17, A, 24, B, 9
As such, the spectator's cards are in the 18th and 43th position, respectively. This works for other numbers than 9, 18 and 25, as long as the original setup can (almost) guarantee the jokers will be in the first two cut piles.