They are both correct.
'Walk as far as we could" refers to distance.
"Walk as long as we could" refers to time.
Yesterday, I ran as far as I could but could only make it half-way - about 5 kilometers.
Yesterday. I ran as long as I could but only managed 2 hours and then I had to stop.