An armed man hijacked a bus in the Brazilian city of Rio de Janeiro on Tuesday, taking 37 commuters hostage before freeing six of them, officials and local media said.