I noticed that there are two coins under the first main bridge leading into the castle. I am trying to side-flip and wall bounce to get them both, but do they have any use as I am not in a 'world' right now?
Those coins, along with all the other coins you can find in the castle, have no significance, and you do not get a star for collecting them.
I believe at some point in development, there would have been a Star for gathering all 100 coins in the castle itself, but it was dummied out.
To get the coins anyway, see the spoiler below.
You need to get all 120 stars and then blast your way to the roof with the cannon. Up there, you will find Yoshi, as well as several Wing Cap blocks that you can use to fly around the castle area and gather the coins under the bridge.