In a song I am learning there is B5 chord but the bass note plays an A on the strong beats which, if I am not mistaken, would make this a Bm7/A or a B7/A (more likely if the key is E) so shouldn't the chord be named as such in the notation for the song? Please see the following.
Although the presence of a note on a strong beat hints at its importance, it is not definitive. In this case, the A in the bass is an accented lower neighbor – not actually part of the defining harmony. The B in the bass is the actual chord tone.
Responding to the comment on the other answer: no, even if the A were the only pitch in the bass, it could still be functionally outside the primary harmony. Harmony is interpretive, so one arranger might call the chord B5/A and another just B5.
Even if the A were considered part of the chord, there are other reasons chord names might differ from the written notation. For example, in the original piece (assuming this is an arrangement for piano), perhaps the (rhythm) guitar plays B5 and some other instrument (bass, say) plays plays the A. Since chord symbols in this type of arrangement are often intended for guitar, B5 is the accurate designation. Put another way: the chord symbols may be reflective of the actual guitar part rather than a summary of the piano part.
Note, too, that the written guitar part has E on the strong part of two beats. One could just as well ask why the chord isn't called Bsus or Bsus/A. Ultimately the answer lies in the original form of the piece and the choices of the arranger who created this version.
This is an example of an appoggiatura, an added non-chord note that is resolved to the regular note of the chord. This is more often seen in melody lines. Since the underlying harmony is B, that's what the chord symbol shows.