Yes one can take them together to ensure the prevention of vitamin B12 deficiency.
Older adults are particularly at risk of vitamin B12 deficiency because of the high prevalence of atrophic gastritis-associated food-cobalamin (vitamin B12) malabsorption, and the increasing prevalence of pernicious anaemia with advancing age. Not only this, certain medications can also result in B12 malabsorption and result in deficiency.
Diet and vitamin supplementation hugely helps in B12 absorption. To increase the amount of vitamin B12 in your diet, eat more of foods that contain it, such as: eggs, liver, and chicken. Fish and shellfish such as trout, salmon, tuna fish, and clams
Esophageal test will measure if you have low stomach acid.
Stomach acids can be treated by having medications which block the acid production. And also by consuming antacids.