Neither formula is that great. I really do not like horsetail grass (shavegrass) primarily due to its vasoconstrictive effects. This is especially bad for people with kidney disease or impaired circulation such as diabetics.
And both formulas contain uva ursi, which is just going to bind the other herbs in the formula. This is the most common formulating mistake I see.
If I had to choose between the two though I would go with the second one.
Also could you advise a protocol to be followed by a person who is going through great pain in kidneys due to stones (best ways to dissolve the most common types), has a beggining infection and has a brutal headache?
The uva ursi and juniper berry should wipe out the infection, but the urine has to be kept alkaline for uva ursi to work. So I recommend taking the formula with nettle leaf, which also dissolves the two most common forms of stones.
Magnesium malate also dissolves both uric acid and calcium oxalate stones.
Another good choice is chanca piedra (Phyllanthus niruri).
PS. Will treating the infection with about 4-6 cloves of garlic a day do the job?
Garlic is another one of those over hyped remedies. The uva ursi and juniper are much better choices.