You could simply use 2 background image sprites, each one containing parts of your track ( frame 1,2,3,4 etc.... ) First one is on screen and at frame 0, second one is behind it to the right and set to frame 1, they will scroll left at same speed. So as the first one scrolls left and gets out of the view reposition it behind the second one currently on screen, each time you re-position advance 1 frame. This way you create a background scenery loop. It will require some graphics work to make it look seamless. You can also measure distance based on which frame is currently showing. If each segment is 20 m., then at frame 10 you'd be around 200 m.
This way you don't need arrays nor huge levels, just normal level size, squirrel does not actually move, scenery does.