In a Lightning Network who commits to the blockchain the final transaction? So let's imagine a Lightning Network made up of thousand of nodes. Transactions are routed until the moment comes where all the channels need to be closed and commited I presume. Which node actually takes care of this? 

I'm a bit confused of this process and it's not clear how the final transaction will be built, and more importantly, who will actually pay the fees to the BTC network?

I imagine this huge transaction will have lots inputs-ouputs based on the parties involved in the network for that moment of time. 

I'm thinking it's a race game, right? So any node can broadcast this huge transaction to the blockchain, and since all the inputs-outputs have all the right signatures of the participants, all the money and fees will go to the nodes that helped route the transactions around, and of course all the money will correctly go to the right destinations.

Also, I'm thinking this is not something that happens every 10 mins or so. Whoever is listening and has the transactions in hand can build this huge transaction (as long as the timelocks are respected) and soon it will be mined.

But still, if the fee for the this huge tx is higher than what that single node got for routing it, what's the incentive for them to actually broadcast it rather than letting another node broadcast it, and hence put the burden on another node to pay the fees.
So let's imagine a Lightning Network made up of thousand of nodes. Transactions are routed until the moment comes where all the channels need to be closed and commited I presume. Which node actually takes care of this?


No, that is not how lightning works. All channels are not created and closed at the same time. They are created individually and closed individually. Each channel has its own 2-of-2 multisig, not the entire route. And channels are not established just for one route, that would be inefficient. Routing happens because there are channels that are already open between people and it is more efficient to route than it is to establish a new channel.

When a channel is closed, the two people in that channel will create the final commitment transaction for that channel and once that is broadcast and confirmed, the channel is closed.


  who will actually pay the fees to the BTC network?


With the current lightning protocol, the person who requested the creation of a channel will be the one who pays any transaction fees. Although if both parties mutually requested the creation of the channel, they can probably split the fees with a bit of manual transaction modification/creation.


  Whoever is listening and has the transactions in hand can build this huge transaction (as long as the timelocks are respected) and soon it will be mined.


No. Commitment transactions require the signatures of the parties involved in the channel.