A bill that would require transgender people in Montana to use the bathroom that aligns with their sex at birth has cleared one of its last legislative hurdles before going to the governor.