Throwing an empty bottle out of moving train

I was travelling from Kigoma to Tabora by train. Along the journey, I was boozing from a disposable beer can. After seeping the contents from the bottle I threw the empty bottle outside the train through the window while the train was moving. The wagon attendant saw me when I threw the bottle and furiously came to where I was seated and threatened to take legal action against me. I was adamant because I didn’t see my fault as the bottle I threw didn’t harm any person given that at the time of throwing it the train was passing through a thick forest. He warned and admonished me not to repeat the act. Is what I did punishable under any law?
PO, Tabora

Your act of throwing the empty bottle from a train is punishable under the Railways Act, 2002 (the Act). Section 49(l) of the Act, prohibits throwing from a train any article or substance which is likely to be a source of danger to, or cause injury to any other person. Your defence that the bottle you threw from a train didn’t harm any person is not tenable because the law, according to the cited section of the Act, punishes even when there is a likelihood of the thrown object to be a danger to any other persons. That you were passing through a thick forest when you threw the bottle is not a good defence, as the likelihood of causing a danger still existed.

If you were charged in Court, the act of throwing the empty bottle from the train, upon conviction, carries a fine not exceeding TZS 2M or to imprisonment for a term not exceeding 6 months or to both such fine and imprisonment.