Is it economically viable for Emirates to use a 777 for some of these routes?
There are many reasons an airline may fly to a given destination and the economics of air travel are complex to say the least. I would like to fist address your question 


  couldn't the people living around Bologna take a train to Milan to get
  to Dubai


Sure they could but airlines don't only service locations because of the people that live there they may service them for the very people that don't. I fly both commercially and as a GA pilot to explore new places. I generally fly out of the Philadelphia area which is one of the busiest in the US. From there I head to plenty of tiny airstrips all over the place, none of these airstrips are in towns that are as economically prosperous or busy as Philadelphia but they see my travel because I wish to explore the area. The same goes for foreign airports, simply because a country is less economically prosperous or "busy" than another does not mean it has less to offer culturally and in fact may be a hot bed for tourism.

I have personally been to both Prague and Bologna and they are great cities both with large tourist markets. I can see it being very economical to fly a wide body airliner there full of tourists and maybe only a few locals. While layovers may attract the lower budget fliers there are plenty of people who prefer a direct flight for both the convenience and time savings.  

You may be able to find more stats here.