  We theoretically investigate the formation of $W$ states in a tripartite
system composed of three charge qubits coupled to vibrational modes. The
electromechanical coupling is responsable for second order virtual processes
that result in an effective electron-electron interaction between neighbor
qubits, which yields to the formation of $W$ states. Based on the Lang-Firsov
transformation and perturbation theory, we analytically solve the quantum
dynamics, providing a mathematical expression for the maximally entangled $W$
state. Dephasing is also taken into accout, paying particular attention on the
robustness of bipartite entanglement against local dephasing processes.
