saywhatagain
This was always confusing to me when I was studying Ayurveda as well so I looked into the issue quite a bit. There are a couple different ways to think about it. Ayurveda uses the term prabhava for a substance that works the opposite way that we would expect. Ayurveda teaches that the sour taste increases pitta (fire), which increases acidity. The sour taste is activated by acidic substances, so acid substances would normally increase pitta and acidity in the body. There are exceptions as you mentioned that lemon and ACV, although they are sour and very acidic, they actually decrease pitta and acidity in the body. There is another big exception, the fruit amla is also very good at reducing and removing acidity from the body although it is extremely sour.
The one I looked into the most was lemon and what I found out is that the acid contained in lemon is a very week acid and doesn't tend to be assimilated by the body very much but the other alkalizing minerals are used and hence you have a net alkalizing, cooling, acid reducing effect. There is also the added bonus that the sour taste in lemon causes the liver to dilate, further increasing the pitta (fire) removal from the body (the liver holds a lot of the pitta so it's contraction helps to remove this from the body). I would guess that amla also works in a similar way. Amla also works as a laxitive and hence encourages the body to clear pitta (fire) and acidic substances from the intestine.
I haven't looked into ACV as much but it is interesting to note that all other vinegars would greatly increase pitta and acidity in the body. Apples are known to be an extremely pitta reducing food, so certainly this contributes to the reason that it has the opposite effect that we might expect.
On to orange juice or tomatoes. These are both somewhat sour substances and in my experience there can be quite a bit of variation in the acidity of these foods. Similar to lemons, the acidity in oranges is actually somewhat of a week acid so some oranges actually can be alkalizing and pitta reducing. The orange juice that you might buy in a grocery store will most certainly be acidifying, due to the fact that it is using oranges with more of the sour taste, concentrated, pasteurized, etc. A fresh orange could be alkalizing or acidifying depending on the chemical make-up of that particular orange. Some foods are not always black-and-white acidifying or alkalizing, there are gray areas.
Generally, tomatoes are considered acidic and this would be more when they are concentrated and pasteurized or cooked into a tomato sauce (very acidifying). Are there some tomatoes when eaten raw and fresh that could be alkalizing? Possibly, I would have to look into that more.
As far as general rules on what will be alkalizing or acidifying, that is a much bigger question and I have been planning to try to address this issue in full in a later post.