How long before Compact Diesels are obsolete? Answer is 100 years but probably longer. Now will there be alternate powered ones sooner? sure. Energy storage just isn't efficient yet for long enough use for tractor loads and the work they do and then there is the higher rolling resistance where tractors are used, soft ground, brush, mud, snow, etc. These are all high energy draining activities.
An electric motorcycle or small car is typically empty or very lightly loaded and on a paved surface which provides much lower rolling resistance. Have seen the same question about HD diesel pickups, answer is the same.