There are 3 main things to check with engines, air, fuel and spark.
Being a bike (presumably CV carbs) air wont be an issue
Spark is obviously fine because it starts and revs
But if its got restricted fuel flow, then as soon as you put load on the engine it cant keep up. I had the same issue on my 250 when I first got it.
My main fuel line was 90% blocked, on reserve worked great, on the main fuel line it would rev as you say, but never got far before stalling again.
Just check the lines and filters from the tank to the fuel tap, the tap to the carbies and then as a last resort try pulling off the carbies and cleaning out the jets.