I have a motor with the following specifications: 24V,10A, 250W. If I run the motor using battery of 35Ah, for about 5 seconds, What will be the power consumed by the motor ?
There are 60 X 60 = 3600 seconds in an hour, so 5 seconds is 5/3600 = 0.00139 hours. In terms Amp-Hours, running at 10 amps for 5 seconds the motor will use 10 X 0.00139 = 0.0139 Ah. If the motor is not fully loaded, it will draw less than 10 amps and will use less energy. If there is a controller between the battery and motor, the controller will add to the energy used.
A motor specification like that tends to give the rated maximum power. That is, the power the motor can run at indefinitely without overheating.
If you just connect a motor to a battery, and run it without a load, then once it is up to rated speed, it will tend to take much less than its maximum power, possibly only 5% to 10% of it, to cover its running losses (mostly churning the air in the air-gaps of the motor).
If you connect a motor drawing (say) a power of 20 watts to a battery for 5 seconds, it will consume a total energy of 20*5 watt.seconds = 100 Joules.
For a 24v battery, 1Ah = 24 * 1 * 3600 = 86400 watt.seconds ~ 86kJ.
So you can run on off-load motor for many 5 second bursts from your 35Ah battery. You can run it at full load for quite a long time as well.