I'd also note that if Austria was located in Southern Africa they would not have a powerful army and mediocre navy, but would rather likely build themselves the other way around. Austria-Hungary had the first and second strongest armies in the world on their border, Italy (top 7 or so strongest) and two hostile little countries (Romania and Serbia) there as well, and France (third strongest army in the world) within striking distance. This means they have to prioritize land forces.It's worth noting that location matters. A country like Austria-Hungary can influence the foreign policy of Russia, Italy, France, Germany, or The Ottoman Empire in places like the Middle East, East Asia, or the Pacific fairly easily by creating credible threats that can't be ignored in Europe and using those at the right time to get others to look out for certain things overseas for them. Russia can ultimately ignore Romania's position on things like their next wars with the Ottoman Empire for domination of the Middle East or Japan for domination of Northern China and Korea. But they cannot ignore Austria-Hungary.
Austria can ultimately exert strong influence indirectly on places they have no actual bases near by virtue of being able to use the worlds 4th strongest army to pressure their neighbors, who are in control of or interested in said far away lands.
Also, Austrian culture was deeply influential. Prestige is a big deal if you want to be a Great Power.
Austria-Hungary had the resources for a bigger military and could have tried focusing on an overseas empire if they wanted, but surrounded by Great Powers and hostile little countries, with the British having the ability to lock them inside the Med and Italy to the ability to bottle them up even further, it is kind of redundant to focus on building a badass navy or overseas empire.