Mercedes-Benz is to build a new plant in Hungary and extend its Rastatt factory in Germany, widening its entry-level compact car line and targeting eastern European markets.