It depends on how your game works. Both of your leads are correct if you just need to know what tile is under the player. Between the two, again depending on your type of game and gameplay, I'd use the one using a Raycast.
TL;DR: if you organize your grid objects in a linear way (from first to last) you could easily find the cell your player is on with a simple calculus.
However, on a grid based game, there is something less consuming than a Raycast based system or a hierarchy swap system. You could simply use Maths :) if you know the size of your grid cells, the origin of your grid, and the world position of your player... then it'd be easy to know what tile your Player is on.
Let's say that your grid is a width 5 and height 6 grid of 2 units cells. Your player is on, let's say, x: 1.2 and y:3.5. The origin (bottom left) of your grid is on 0,0.
cell_x = player_x / cell_size = 1.2 / 2 = 0.12 = 0
cell_y = player_y / cell_size = 4.5 / 2 = 2.25 = 2
In this example your player is on cell x 0 and y 2. So now... "I know the cell coordinate, but I still do have the reference of it". Now let's say you have a GameObject named grid that contains all the cell GameObject as child. The first one would be cell id 0, the second one would be id 1, ... and the last one would be id width * height - 1, in our case id 29 (5 * 6 - 1).
How to convert a x,y cell position into and id? That's pretty simple:
id = y * width + x. In our example above, position x 0 and y 2 would give us
id = y * width + x = 2 * 5 + 0 = 10.
To get your GameObject reference, you can get the cell child you want on your grid GameObject by:
GameObject cell = grid.transform.GetChild(id).gameObject;. Et voila.