It has been noted in the comments and I shall repeat that the premise of the question is already bogus. The question does not consider two different ions but two mesomeric depiction of the same ion. This is also evident by the mesomeric arrow between the two forms. Since mesomery strictly means that no geometrical change takes place, both depictions are identical in all aspects and have the same (resonance-influenced) energy. Thus, any book claiming that either of the two have a lower energy is wrong.
However, what is commonly done is to determine a more likely resonance structure. This is, for example, commonly used to explain the strongly stabilised nature of certain aromatic systems, e.g. when DMAP (4-N,N′-dimethylaminopyridine) is used as a carboxylic activating agent. We can attempt to do that for your structure, too. If we compare the two we see — of course — that a lot of features are identical. The principal differences are:
- A has a trisubstituted double bond while B only as a disubstituted (and terminal) double bond
- B has a secondary carbocation while A has a primary one (both, however, are allylic).
Since allylic stabilisation for cations is much stronger than hyperconjugation, we can discard the second bullet point as being essentially equal for both resonance structures. Thus, we should argue with the location of the double bond. Both double bonds can benefit from hyperconjugation twice (the primary cation of A cannot hyperconjugate due to geometry), but in A the two hyperconjugations stabilise different carbons. Along with the general double bond stability given as:
$$\text{monosubstituted} < \text{terminal disubstituted} < \textit{cis} < \textit{trans} < \text{trisubstituted} < \text{tetrasubstituted}$$
we can identify A as being slightly better than B and therefore contributing slightly more towards the overall structure.
You mentioned in the comments that your book states:
structure B is not planar and hence conjugation is not possible in it
Your book probably wants you to assume that the following depiction in figure 1 is adequate for the two resonance forms:

Figure 1: structures B and A under the assumption of a chair-configured cyclohexyl structure for B.
Under the underlying assumption of a different geometry for both structures, this may be valid. However, there is no way that cation B will adopt a chair cyclohexane configuration. Instead, as I mentioned above, the following structures in figure 2 are much more likely and even show that we are dealing with resonance:

Figure 2: depiction of the mesomeric forms without geometry change.
You can easily see that the argument of non-conjugation is bogus, since there very well is a way to optimise geometry so that the orbitals may form an allyl system.