What is the difference between B as in the longer base of a trapezoid and b as in base in terms of geometry?

none, as long as you are talking about the longer base of a trapezoid.

Often, though, b refers to the base of a triangle. Also, it may be the shorter base of a trapezoid.