No. There are signs posted everywhere stating that you may not drink alcohol on public transport. However, that rarely stops anyone from doing so; especially on the Ubahn and Sbahn as there is not driver to reprimand you. My recommendation is if you do drink on the train, just don't be obvious, loud, or drunk.