Here is how we document such an arrangement. Bank lends money to Company A to purchase a commercial vehicle to lease to Company B. The commercial vehicle is titled to Company A until the lease expires and the loan is repaid. The Security Agreement is signed by Company A. An Assignment of the lease is signed by Company A and acknowledged by Company B.
Different state laws may vary this procedures.