The fourth of the Recollections of the Bhikkhu’s Requisites is:
Properly considering medicinal requisites for curing the sick, I use them: simply to ward off any pains of illness that have arisen, and for the maximum freedom from disease.
There is an allowance in the Pali texts that “medicinal-tonics” can be taken in the afternoon while “lifetime-medicines” may be consumed any time they are needed.
There are different interpretations and practices about how ill a bhikkhu has to be for it to be allowable to take such “medicines”.
Some bhikkhus will not take anything other than pure water, while some will over-stretch the Rule to even drinking “medicinal” food-drinks (e.g. Ovaltine) in the afternoon.
Some bhikkhus will consider tea-leaves allowable (as “herbs”) while some will see it as food or as a “stimulant” (caffeine) and therefore not appropriate.
Also, the ordinary rural villagers of South East Asia (until very recently) would have had no tea or coffee to drink, so such items could be considered quite a luxury.
It will depend on local conditions and interpretations, which are allowed for in the Vinaya through the Great Standards.
Learn more about the Theravadin Buddhist Monk’s Rules here:
The Bhikkhus’ Rules – Guide for Laypeople