Is it not possible to generate electricity from wind in a train

It is possible to generate electricity from a wind mill located atop a moving train. Although as plausible and tempting as this may sound, a closer analysis would reveal that such a venture would eventually defeat its very purpose.

A train cruising at its average speed would pierce the air around at speeds sufficient to drive a windmill. The energy generated from this apparatus could be considerable since the train runs for a long duration as the case in point. But the placement of this apparatus atop or beside the train’s compartment would generate a drag force opposing the direction of the train’s movement.

This overhead would reduce the train’s speed and thereby necessitate the engine to spend much more energy to retain its speed. The extra energy which the engine requires to keep up its speed would be much more than the energy generated from the windmill. Added to this is the inevitable problem of friction which causes energy loses while converting energy in one mechanical to another mechanical form.

This question recalls the zeal behind perpetual motion which prevailed in the early 17th century. None of such ventures could succeed because no mechanical apparatus is devoid of friction.