Two persons were entrapped on the Sparta elevator when while riding in the elevator it stopped approximately 42' from the top landing due to the bottom hallway door latch being out of adjustment. The fault was reset on the elevator and it was called to the top where the persons exited the elevator and the door latch arm was adjusted and the elevator was tested.