Difference between various linear regression implementations
In the first, you need a linear model and the cost function is RMSE. with this model and cost function, w is generated.

on the other hand, for the second equation, you use a non-linear NN equation as estimation and the cost function may RMSE, log or ... .( NN without activation-function is linear)
NN without activation function is a linear model with bias. if you use RMSE it is like the first example.

any linear regression with the same cost function will generate, the same value for coefficient after convergence (In some condition the equation has many solutions, In this case, the cost function may converge to a new value)

Note: many solutions for an equation meaning, for example, if one point is the solution of the equations, then any hyperplane that crosses that point is the solution.