There are two parts to this question. The first is, can it physically keep up? As you mentioned, the range of 300 m per flight is specifically stated. From this page, we can deduce that one 90 second flight per day will cover the 300 meter distance. No doubt some of that power will be reserved for the first few seconds of flight, but it seems quite likely that Ingenuity could easily keep up with Perseverance, with an average distance likely of only maybe 10-20 m/ day likely on that front.
The second part is how long can that be kept up? Well, this is a bit harder to know for sure. NASA has released a paper that details some of the system, including the power system, so let's take a look! The end-of-life battery power is estimated at 35.75 Wh. Of this. 10.73 Wh is reserved for improved battery life and emergencies, 21 Wh is reserved for night time heater use. This leaves 10 Wh for flight per day, assuming flight is done to still allow some charge. Using those values, a 90 second flight is still possible at EOL. The batteries spec sheets show about a 20% degradation after 500 charges.
There are still a few unknowns in that. One will note that the total power budget for a day is 41, while the estimated EOL batter power is actually 36 Wh. I believe this will be accomplished with mid-day flights every other day when things are starting to get tougher.
The bottom line, however, is at least 31 Wh are needed just to ensure enough power to survive, as is currently planned. I believe that will happen after about 1000 charges. Even without a flight, the amount of discharge per day is quite significant. I believe that Ingenuity cannot survive longer than about 4 years, unless an optimal heating strategy is determined at some future date.