Bangladesh handed Australia a reality check in Darwin, registering a win in the opening Test of the two-match series.