Not sure about "indefinitely." But certainly food ration bars will keep you alive for at least weeks and probably months. But I suspect they would eventually take their toll on you in ways such as in your digestive tract.
You can go a long time with little or no food before you break down, compared to the need for good drinking water. Consider that water and the ability to filter/purify water should be your number one priority. If you have a good filter and purification tabs in your vest or bag, along with some food ration bars--you'll be set to sustain yourself for at least a little while in many scenarios.