Unit tests are independent from each other by design. The ordering can be changed, but they shouldn't depend on each other's results.
In your case, you need to put load_page_b_if_previous_function_is_true
inside test_element_a_in_page_a
.
In general, you will need to write a single test function for each Selenium scenario. You cannot split actions which depend on each other into several test cases.