Hmmm...that might work ! You'd have to stack the glass pretty high, though. I've seen leaves and trees as high as 15-ish blocks above the surface. Should be possible, yes, but will require hundreds if not thousands of glass - depending upon the track length.
So, let's say total length is 100. 15 high. That's 1,500 glass. If you cut the height down to 10, which covers 95% of the maximum tree height, you're still looking at 1,000 glass.
The problem then is you're also cutting down on the saplings, apples, and even branches (wood). So, on the total, you're probably losing out net-energy-wise. But, it would be cool to see if it works.