Is the trail measurement to correct thing to look at when deciding if two bikes will behave similarly?

Assuming the same tire size, the two metrics that affect trail and head tube angle and fork offset. If two bikes have the same trail measurement but:

Bike A has a steeper HTA and a smaller offset and

Bike B has a slacker HTA and larger offset

Will the bikes ride similarly? I’m just wondering if arriving at a given trail in two different ways results in a different ride.

Hard to create such isolation and make generalizations. In your example, you can try to keep much of the other stuff “equal”, but if you truly have the same trail value driven from different Head Tube Angle and Fork Offset, the front tire will actually be in a different location with respect to the rider weight. That assumes equal Reach, Stack and such with respect to rider placement to the Top of the Head Tube.

Essentially, in my case above, despite the same Trail, the handling will likely feel different due to different weight distribution on the front tire. It’s all but impossible to change one thing on a bike without affecting one or more other aspects.

I don’t consider Trail to be the leading attribute I look at when comparing geo and predicting handling. It’s at least secondary to me as I consider Wheelbase, Chainstay Length (aka Rear Center), Front Center, Head Tube Angle, not to mention Reach & Stack. It can be important to look at Trail too, but it’s not the first one IMO.