A bearing like that is technically an azimuth. It is turned clockwise from north or the positive y-axis right around the circle.
325-235=90, so you have a right triangle which is easy to work with.
Boat A travels 14*2.5=35 km
Boat B travels 18*2.5=45 km.
So you have two sides of length 35 and 45 and a 90 degree angle.
All you need is Pythagoras.