If you are very fortunate, the inverter will be 75-80% efficient (including losses in your cable if you minimize them). If the engine is not running, the battery voltage will only be 12V.
For 400W out, then you'll need 500-533W in. At 12V, that's almost 45 amperes. If your 24AH battery could be 100% efficient, that would be only 30 minutes.
However at 2C (twice the Ampere-Hour number) it probably will only give half of that time (e.g. 15 minutes) before either going flat or exploding.
It will last longer if you don't actually use the full 400W from the inverter. If the motor is running, the good news is the input voltage is about 13.8 volts, the current is only 39A, and if the charging system can keep up, everything is happy.