Police have used tear gas to break up crowds of protesters who blocked roads and brought most public transport to a halt across Brazil.