Ambush works only in 2 cases:
1. Attacker is a noob or is playing just for fun. He will not follow his attack at all, so even with online status you can ambush him as well
2. Attack is not against boxed province, but against the other provinces and his army is separated in 4-6 parts to take as much gold as possible. In this case is possible to ambush with unmobilized army. This will work only in realms without online status.
If the game is played correctly, is not possible to ambush in realms with online status, if you are not extremely luck (for example logging on 15-20 seconds before enemy attack will arrive)
All the other cases spoken here fall in the first case (attacker is a noob)
So send your army to defend 11 or 30 min before is not that will change anything at all. The attacker simply is not there at all
Anyway, you will have fun with ambushes with you play at low points